aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/trace_ksym.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/trace/trace_ksym.c b/kernel/trace/trace_ksym.c
index 160a8d8b37a2..67d79f709fc5 100644
--- a/kernel/trace/trace_ksym.c
+++ b/kernel/trace/trace_ksym.c
@@ -32,6 +32,8 @@
32#include <linux/hw_breakpoint.h> 32#include <linux/hw_breakpoint.h>
33#include <asm/hw_breakpoint.h> 33#include <asm/hw_breakpoint.h>
34 34
35#include <asm/atomic.h>
36
35/* 37/*
36 * For now, let us restrict the no. of symbols traced simultaneously to number 38 * For now, let us restrict the no. of symbols traced simultaneously to number
37 * of available hardware breakpoint registers. 39 * of available hardware breakpoint registers.
@@ -44,7 +46,7 @@ struct trace_ksym {
44 struct perf_event **ksym_hbp; 46 struct perf_event **ksym_hbp;
45 struct perf_event_attr attr; 47 struct perf_event_attr attr;
46#ifdef CONFIG_PROFILE_KSYM_TRACER 48#ifdef CONFIG_PROFILE_KSYM_TRACER
47 unsigned long counter; 49 atomic64_t counter;
48#endif 50#endif
49 struct hlist_node ksym_hlist; 51 struct hlist_node ksym_hlist;
50}; 52};
@@ -69,9 +71,8 @@ void ksym_collect_stats(unsigned long hbp_hit_addr)
69 71
70 rcu_read_lock(); 72 rcu_read_lock();
71 hlist_for_each_entry_rcu(entry, node, &ksym_filter_head, ksym_hlist) { 73 hlist_for_each_entry_rcu(entry, node, &ksym_filter_head, ksym_hlist) {
72 if ((entry->attr.bp_addr == hbp_hit_addr) && 74 if (entry->attr.bp_addr == hbp_hit_addr) {
73 (entry->counter <= MAX_UL_INT)) { 75 atomic64_inc(&entry->counter);
74 entry->counter++;
75 break; 76 break;
76 } 77 }
77 } 78 }
@@ -501,7 +502,8 @@ static int ksym_tracer_stat_show(struct seq_file *m, void *v)
501 seq_printf(m, " %-36s", fn_name); 502 seq_printf(m, " %-36s", fn_name);
502 else 503 else
503 seq_printf(m, " %-36s", "<NA>"); 504 seq_printf(m, " %-36s", "<NA>");
504 seq_printf(m, " %15lu\n", entry->counter); 505 seq_printf(m, " %15llu\n",
506 (unsigned long long)atomic64_read(&entry->counter));
505 507
506 return 0; 508 return 0;
507} 509}