diff options
Diffstat (limited to 'tools/perf/util/bpf_skel/lock_contention.bpf.c')
-rw-r--r-- | tools/perf/util/bpf_skel/lock_contention.bpf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/util/bpf_skel/lock_contention.bpf.c b/tools/perf/util/bpf_skel/lock_contention.bpf.c index 67d46533e518..9e8b94eb6320 100644 --- a/tools/perf/util/bpf_skel/lock_contention.bpf.c +++ b/tools/perf/util/bpf_skel/lock_contention.bpf.c @@ -12,7 +12,7 @@ #define MAX_ENTRIES 10240 struct contention_key { - __u32 stack_id; + __s32 stack_id; }; struct contention_data { @@ -27,7 +27,7 @@ struct tstamp_data { __u64 timestamp; __u64 lock; __u32 flags; - __u32 stack_id; + __s32 stack_id; }; /* callstack storage */ @@ -73,6 +73,9 @@ int enabled; int has_cpu; int has_task; +/* error stat */ +unsigned long lost; + static inline int can_record(void) { if (has_cpu) { @@ -116,6 +119,8 @@ int contention_begin(u64 *ctx) pelem->flags = (__u32)ctx[1]; pelem->stack_id = bpf_get_stackid(ctx, &stacks, BPF_F_FAST_STACK_CMP); + if (pelem->stack_id < 0) + lost++; return 0; } |