2020-07-13 12:52:34 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
// Copyright (c) 2020, Oracle and/or its affiliates.
|
|
|
|
|
|
|
|
#include "vmlinux.h"
|
|
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
#include <bpf/bpf_tracing.h>
|
2022-02-04 17:05:20 +05:30
|
|
|
#include "bpf_misc.h"
|
2020-07-13 12:52:34 +01:00
|
|
|
|
|
|
|
char _license[] SEC("license") = "GPL";
|
|
|
|
|
|
|
|
int trace_printk_ret = 0;
|
|
|
|
int trace_printk_ran = 0;
|
|
|
|
|
2021-05-13 17:36:22 -07:00
|
|
|
const char fmt[] = "Testing,testing %d\n";
|
|
|
|
|
2022-02-04 17:05:20 +05:30
|
|
|
SEC("fentry/" SYS_PREFIX "sys_nanosleep")
|
2020-07-13 12:52:34 +01:00
|
|
|
int sys_enter(void *ctx)
|
|
|
|
{
|
|
|
|
trace_printk_ret = bpf_trace_printk(fmt, sizeof(fmt),
|
|
|
|
++trace_printk_ran);
|
|
|
|
return 0;
|
|
|
|
}
|