109d8ad16SSong Liu // SPDX-License-Identifier: GPL-2.0 209d8ad16SSong Liu /* Copyright (c) 2020 Facebook */ 309d8ad16SSong Liu 409d8ad16SSong Liu #include "vmlinux.h" 509d8ad16SSong Liu #include <bpf/bpf_helpers.h> 609d8ad16SSong Liu #include <bpf/bpf_tracing.h> 709d8ad16SSong Liu 809d8ad16SSong Liu __u32 count = 0; 909d8ad16SSong Liu __u32 on_cpu = 0xffffffff; 1009d8ad16SSong Liu 1109d8ad16SSong Liu SEC("raw_tp/task_rename") BPF_PROG(rename,struct task_struct * task,char * comm)1209d8ad16SSong Liuint BPF_PROG(rename, struct task_struct *task, char *comm) 1309d8ad16SSong Liu { 1409d8ad16SSong Liu 1509d8ad16SSong Liu count++; 1609d8ad16SSong Liu if ((__u64) task == 0x1234ULL && (__u64) comm == 0x5678ULL) { 1709d8ad16SSong Liu on_cpu = bpf_get_smp_processor_id(); 1800e8c44aSJohn Fastabend return (long)task + (long)comm; 1909d8ad16SSong Liu } 2009d8ad16SSong Liu 2109d8ad16SSong Liu return 0; 2209d8ad16SSong Liu } 2309d8ad16SSong Liu 2409d8ad16SSong Liu char _license[] SEC("license") = "GPL"; 25