• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2020 Facebook */
3 
4 #include "vmlinux.h"
5 #include <bpf/bpf_helpers.h>
6 #include <bpf/bpf_tracing.h>
7 
8 __u32 count = 0;
9 __u32 on_cpu = 0xffffffff;
10 
11 SEC("raw_tp/task_rename")
BPF_PROG(rename,struct task_struct * task,char * comm)12 int BPF_PROG(rename, struct task_struct *task, char *comm)
13 {
14 
15 	count++;
16 	if ((__u64) task == 0x1234ULL && (__u64) comm == 0x5678ULL) {
17 		on_cpu = bpf_get_smp_processor_id();
18 		return (long)task + (long)comm;
19 	}
20 
21 	return 0;
22 }
23 
24 char _license[] SEC("license") = "GPL";
25