From ff910cfdc6e928c31344245cca70e391634ba560 Mon Sep 17 00:00:00 2001 From: Jeremy Linton Date: Wed, 31 May 2017 16:56:52 -0500 Subject: tracing: Add TRACE_DEFINE_SIZEOF() macros There are a few places in the kernel where sizeof() is already being used. Update those locations with TRACE_DEFINE_SIZEOF. Link: http://lkml.kernel.org/r/20170531215653.3240-12-jeremy.linton@arm.com Signed-off-by: Jeremy Linton Signed-off-by: Steven Rostedt (VMware) --- arch/arm64/kvm/trace.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch') diff --git a/arch/arm64/kvm/trace.h b/arch/arm64/kvm/trace.h index 7fb0008c4fa3..5188c7007169 100644 --- a/arch/arm64/kvm/trace.h +++ b/arch/arm64/kvm/trace.h @@ -93,6 +93,8 @@ TRACE_EVENT(kvm_arm_set_dreg32, TP_printk("%s: 0x%08x", __entry->name, __entry->value) ); +TRACE_DEFINE_SIZEOF(__u64); + TRACE_EVENT(kvm_arm_set_regset, TP_PROTO(const char *type, int len, __u64 *control, __u64 *value), TP_ARGS(type, len, control, value), -- cgit v1.2.3 From fbb789f0d631473585d17afb120d07561d329689 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Mon, 26 Jun 2017 18:17:49 -0400 Subject: sh/ftrace: Remove only user of ftrace_arch_read_dyn_info() I noticed that there's only one user of ftrace_arch_read_dyn_info(). That was used a while ago during the NMI updating in x86, and superh copied it to implement its version of handling NMIs during stop_machine(). But that is a debug feature, and this code hasn't been touched since 2009. Also, x86 no longer does the ftrace updates with stop_machine() and instead uses breakpoints. If superh needs to modify its code, it should implement the breakpoint conversion, and remove stop_machine(). Which also gets rid of the NMI issue. Anyway, I want to nuke ftrace_arch_read_dyn_info() and this gets rid of the one user, which is for an arch that shouldn't need it anymore. Link: http://lkml.kernel.org/r/20170626181749.2ce954d1@gandalf.local.home Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Signed-off-by: Steven Rostedt Signed-off-by: Steven Rostedt (VMware) --- arch/sh/kernel/ftrace.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'arch') diff --git a/arch/sh/kernel/ftrace.c b/arch/sh/kernel/ftrace.c index 53783978162e..d18724d186f3 100644 --- a/arch/sh/kernel/ftrace.c +++ b/arch/sh/kernel/ftrace.c @@ -96,19 +96,6 @@ static int mod_code_status; /* holds return value of text write */ static void *mod_code_ip; /* holds the IP to write to */ static void *mod_code_newcode; /* holds the text to write to the IP */ -static unsigned nmi_wait_count; -static atomic_t nmi_update_count = ATOMIC_INIT(0); - -int ftrace_arch_read_dyn_info(char *buf, int size) -{ - int r; - - r = snprintf(buf, size, "%u %u", - nmi_wait_count, - atomic_read(&nmi_update_count)); - return r; -} - static void clear_mod_flag(void) { int old = atomic_read(&nmi_running); @@ -144,7 +131,6 @@ void arch_ftrace_nmi_enter(void) if (atomic_inc_return(&nmi_running) & MOD_CODE_WRITE_FLAG) { smp_rmb(); ftrace_mod_code(); - atomic_inc(&nmi_update_count); } /* Must have previous changes seen before executions */ smp_mb(); @@ -165,8 +151,6 @@ static void wait_for_nmi_and_set_mod_flag(void) do { cpu_relax(); } while (atomic_cmpxchg(&nmi_running, 0, MOD_CODE_WRITE_FLAG)); - - nmi_wait_count++; } static void wait_for_nmi(void) @@ -177,8 +161,6 @@ static void wait_for_nmi(void) do { cpu_relax(); } while (atomic_read(&nmi_running)); - - nmi_wait_count++; } static int -- cgit v1.2.3