From patchwork Thu Jun 15 10:52:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 105632 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp740475qgd; Thu, 15 Jun 2017 03:53:18 -0700 (PDT) X-Received: by 10.99.124.65 with SMTP id l1mr4613934pgn.279.1497523998465; Thu, 15 Jun 2017 03:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497523998; cv=none; d=google.com; s=arc-20160816; b=rNArU8B11jJJcZSsQqaMDfCjjbJDWrbcLj42bM4Ss8Oftw7k41qM0rdcWpamP6CS2I vRxdqguiUHJWZMjz5q5v75f6s0z4dHY8UjEt1vUsCiYPQIyKCb8i3qGJEdF0T5b8n1dN mOVEAGiPK5wlAZHc6+tW8Hy0/KACrdG2Pc0wQRF7Aqjk0/bpNr8suj6dpDUFCic02C+d EIyPJybi+Ib7B6AO/mdSTlP9bKRrSFI0/YD5w6Q+k3G04cDUum145YdALzgGG1y6D3q7 nXURacQ5OPCSgwCcxO+tp3xQh9JIsko+LCe7RyhOdnVVKBuOKhykX0Nwcnp8NcLZytzJ ZnWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :dmarc-filter:arc-authentication-results; bh=ie6P1PxdHS3EEacqHDe/4YrsgPfnJ8WXrZRbsLB5s2I=; b=Mtrk0juAYk8oJEsVjzXlN1fnaQNIqdtfZ6ybkPy8n5gVl6eaJSTt6PuBYv2Lwmpt5z GIrPIKq1J0Bmt77JzPhcES1tE45SB79BkrVkJkiePgW87uGSjStuqUZKzXrjvDXDXuUh bZgP/K+3ZctBOu/y6sqyvuETcYq5m4x7++3md62wHEtmOmzKO1DthZoDq8TP0puoG4fI V1CAI8NKlSv1ULro/8G+OwjoRCXrQzbG294xtp8pe9WeP+g7spZOz7Xq46bHndsTsMop 77F3p6DGYcCPo4iJ8cS2oJcsNRkj+A84gNQWfuale/iGgZfHq4V4QtZZ+R/YKmlw1hcs AZdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b187si1122141pgc.359.2017.06.15.03.53.18; Thu, 15 Jun 2017 03:53:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752421AbdFOKw7 (ORCPT + 25 others); Thu, 15 Jun 2017 06:52:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:40470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751016AbdFOKwy (ORCPT ); Thu, 15 Jun 2017 06:52:54 -0400 Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 038BF239B0; Thu, 15 Jun 2017 10:52:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 038BF239B0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Received: from rostedt by gandalf.local.home with local (Exim 4.87) (envelope-from ) id 1dLSOS-0003I3-UD; Thu, 15 Jun 2017 06:52:52 -0400 Message-Id: <20170615105252.867147004@goodmis.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Jun 2017 06:52:25 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jeremy Linton Subject: [for-next][PATCH 02/12] trace: rename kernel enum section to eval References: <20170615105223.551999981@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline; filename=0002-trace-rename-kernel-enum-section-to-eval.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Linton The kernel and its modules have sections containing the enum string to value conversions. Rename this section because we intend to store more than enums in it. Link: http://lkml.kernel.org/r/20170531215653.3240-2-jeremy.linton@arm.com Signed-off-by: Jeremy Linton Signed-off-by: Steven Rostedt (VMware) --- include/asm-generic/vmlinux.lds.h | 6 +++--- include/trace/trace_events.h | 2 +- kernel/module.c | 2 +- kernel/trace/trace.c | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) -- 2.10.2 diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 314a0b9219c6..800f9f9677a6 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -125,9 +125,9 @@ VMLINUX_SYMBOL(__start_ftrace_events) = .; \ KEEP(*(_ftrace_events)) \ VMLINUX_SYMBOL(__stop_ftrace_events) = .; \ - VMLINUX_SYMBOL(__start_ftrace_enum_maps) = .; \ - KEEP(*(_ftrace_enum_map)) \ - VMLINUX_SYMBOL(__stop_ftrace_enum_maps) = .; + VMLINUX_SYMBOL(__start_ftrace_eval_maps) = .; \ + KEEP(*(_ftrace_eval_map)) \ + VMLINUX_SYMBOL(__stop_ftrace_eval_maps) = .; #else #define FTRACE_EVENTS() #endif diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h index 00f643164ca2..4bdd84023f5b 100644 --- a/include/trace/trace_events.h +++ b/include/trace/trace_events.h @@ -43,7 +43,7 @@ TRACE_MAKE_SYSTEM_STR(); .enum_value = a \ }; \ static struct trace_enum_map __used \ - __attribute__((section("_ftrace_enum_map"))) \ + __attribute__((section("_ftrace_eval_map"))) \ *TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a /* diff --git a/kernel/module.c b/kernel/module.c index 4a3665f8f837..9ec4713c5eee 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -3077,7 +3077,7 @@ static int find_module_sections(struct module *mod, struct load_info *info) mod->trace_events = section_objs(info, "_ftrace_events", sizeof(*mod->trace_events), &mod->num_trace_events); - mod->trace_enums = section_objs(info, "_ftrace_enum_map", + mod->trace_enums = section_objs(info, "_ftrace_eval_map", sizeof(*mod->trace_enums), &mod->num_trace_enums); #endif diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 63deff9cdf2c..acd3eb4d56a0 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -7732,15 +7732,15 @@ struct dentry *tracing_init_dentry(void) return NULL; } -extern struct trace_enum_map *__start_ftrace_enum_maps[]; -extern struct trace_enum_map *__stop_ftrace_enum_maps[]; +extern struct trace_enum_map *__start_ftrace_eval_maps[]; +extern struct trace_enum_map *__stop_ftrace_eval_maps[]; static void __init trace_enum_init(void) { int len; - len = __stop_ftrace_enum_maps - __start_ftrace_enum_maps; - trace_insert_enum_map(NULL, __start_ftrace_enum_maps, len); + len = __stop_ftrace_eval_maps - __start_ftrace_eval_maps; + trace_insert_enum_map(NULL, __start_ftrace_eval_maps, len); } #ifdef CONFIG_MODULES From patchwork Thu Jun 15 10:52:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 105639 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp741133qgd; Thu, 15 Jun 2017 03:55:12 -0700 (PDT) X-Received: by 10.84.218.206 with SMTP id g14mr5580660plm.85.1497524112770; Thu, 15 Jun 2017 03:55:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497524112; cv=none; d=google.com; s=arc-20160816; b=ygAcMWnOCmC+83U5+CoQpx1i8yUpoaDCi9RkuR3IAbam09JnK+z5rFoXEeCDOGM+Xp kCsfnC4f8Cq0PMbETPZ/ADFjyyXIKins3MCzRMbc96bT1WT5jZpEjqSwHvLrXAv+UwPJ kUZqh1KD+EmihWgdt9oGNdzHC9Ak/9rcTWnl8bTQo1LHv3kybxnWwp+fx3xfaR1fUQ2C bGh04dL4VaswkNYN/wn4XMHJTYQt8rRvW8LVsShIcjiVaMLKTfGdg0Lc8iZQUTyPxRp+ jali07WrLtvGLk9Tp4zz0j3jpTS4R26d3ybDhvl7IVfIFGcGSkw+O65im30jppyN5xWL FrjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :dmarc-filter:arc-authentication-results; bh=hhRjQ4TCwasgpe4GIrcgUJ9yWr4g0F7Go+AZDV5EbAA=; b=UywutKWytlGyY28v8QoExDV4yIuEOkrIeDr/ATVWAMTo/HQiQuPDlEsndsBFQivoYY 3qBZbf4wvI7w1yBtRoJnE1MeMvm3PpvSbnZ64NnGpdsaA8ZFmU6ij7e910dfkuByyogb 7X4kyY7xfiA8K/DD3dEbqDffqiIb6oGTzXCBzU7zcxy9k/uOJGWFKeJx0rYIM1mxmVh+ mNotZ33OP7LA4y0gUEaW6P8+JZPnMmsMaE9LSa4kCKSo/DzTnmPTE9B/lRzslL8P0gNu plOGhsKKG4GgKPzGJ/1LKVakWVIfcLtWwpPJXLVHO01CIM8PfJt3t+JiIJY0zc0pXCDK jNEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j66si165586pfg.447.2017.06.15.03.55.12; Thu, 15 Jun 2017 03:55:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752687AbdFOKyx (ORCPT + 25 others); Thu, 15 Jun 2017 06:54:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:40524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141AbdFOKwz (ORCPT ); Thu, 15 Jun 2017 06:52:55 -0400 Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57287239BE; Thu, 15 Jun 2017 10:52:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57287239BE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Received: from rostedt by gandalf.local.home with local (Exim 4.87) (envelope-from ) id 1dLSOT-0003Ia-2v; Thu, 15 Jun 2017 06:52:53 -0400 Message-Id: <20170615105253.018540595@goodmis.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Jun 2017 06:52:26 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jeremy Linton Subject: [for-next][PATCH 03/12] trace: rename trace_enum_map to trace_eval_map References: <20170615105223.551999981@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline; filename=0003-trace-rename-trace_enum_map-to-trace_eval_map.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Linton Each enum is loaded into the trace_enum_map, as we are now using this for more than enums rename it. Link: http://lkml.kernel.org/r/20170531215653.3240-3-jeremy.linton@arm.com Signed-off-by: Jeremy Linton Signed-off-by: Steven Rostedt (VMware) --- include/linux/module.h | 2 +- include/linux/tracepoint.h | 6 +++--- include/trace/trace_events.h | 8 ++++---- kernel/trace/trace.c | 24 ++++++++++++------------ kernel/trace/trace.h | 4 ++-- kernel/trace/trace_events.c | 14 +++++++------- 6 files changed, 29 insertions(+), 29 deletions(-) -- 2.10.2 diff --git a/include/linux/module.h b/include/linux/module.h index 21f56393602f..46b48043d741 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -442,7 +442,7 @@ struct module { #ifdef CONFIG_EVENT_TRACING struct trace_event_call **trace_events; unsigned int num_trace_events; - struct trace_enum_map **trace_enums; + struct trace_eval_map **trace_enums; unsigned int num_trace_enums; #endif #ifdef CONFIG_FTRACE_MCOUNT_RECORD diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index cc48cb2ce209..f7b0f5525e46 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -25,10 +25,10 @@ struct module; struct tracepoint; struct notifier_block; -struct trace_enum_map { +struct trace_eval_map { const char *system; - const char *enum_string; - unsigned long enum_value; + const char *eval_string; + unsigned long eval_value; }; #define TRACEPOINT_DEFAULT_PRIO 10 diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h index 4bdd84023f5b..49cce5fb54ee 100644 --- a/include/trace/trace_events.h +++ b/include/trace/trace_events.h @@ -35,14 +35,14 @@ TRACE_MAKE_SYSTEM_STR(); #undef TRACE_DEFINE_ENUM #define TRACE_DEFINE_ENUM(a) \ - static struct trace_enum_map __used __initdata \ + static struct trace_eval_map __used __initdata \ __##TRACE_SYSTEM##_##a = \ { \ .system = TRACE_SYSTEM_STRING, \ - .enum_string = #a, \ - .enum_value = a \ + .eval_string = #a, \ + .eval_value = a \ }; \ - static struct trace_enum_map __used \ + static struct trace_eval_map __used \ __attribute__((section("_ftrace_eval_map"))) \ *TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index acd3eb4d56a0..46fac3f63af1 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -132,7 +132,7 @@ union trace_enum_map_item; struct trace_enum_map_tail { /* * "end" is first and points to NULL as it must be different - * than "mod" or "enum_string" + * than "mod" or "eval_string" */ union trace_enum_map_item *next; const char *end; /* points to NULL */ @@ -148,7 +148,7 @@ static DEFINE_MUTEX(trace_enum_mutex); * pointer to the next array of saved enum_map items. */ union trace_enum_map_item { - struct trace_enum_map map; + struct trace_eval_map map; struct trace_enum_map_head head; struct trace_enum_map_tail tail; }; @@ -4748,7 +4748,7 @@ static const struct file_operations tracing_saved_cmdlines_size_fops = { static union trace_enum_map_item * update_enum_map(union trace_enum_map_item *ptr) { - if (!ptr->map.enum_string) { + if (!ptr->map.eval_string) { if (ptr->tail.next) { ptr = ptr->tail.next; /* Set ptr to the next real item (skip head) */ @@ -4808,7 +4808,7 @@ static int enum_map_show(struct seq_file *m, void *v) union trace_enum_map_item *ptr = v; seq_printf(m, "%s %ld (%s)\n", - ptr->map.enum_string, ptr->map.enum_value, + ptr->map.eval_string, ptr->map.eval_value, ptr->map.system); return 0; @@ -4844,11 +4844,11 @@ trace_enum_jmp_to_tail(union trace_enum_map_item *ptr) } static void -trace_insert_enum_map_file(struct module *mod, struct trace_enum_map **start, +trace_insert_enum_map_file(struct module *mod, struct trace_eval_map **start, int len) { - struct trace_enum_map **stop; - struct trace_enum_map **map; + struct trace_eval_map **stop; + struct trace_eval_map **map; union trace_enum_map_item *map_array; union trace_enum_map_item *ptr; @@ -4902,13 +4902,13 @@ static void trace_create_enum_file(struct dentry *d_tracer) #else /* CONFIG_TRACE_ENUM_MAP_FILE */ static inline void trace_create_enum_file(struct dentry *d_tracer) { } static inline void trace_insert_enum_map_file(struct module *mod, - struct trace_enum_map **start, int len) { } + struct trace_eval_map **start, int len) { } #endif /* !CONFIG_TRACE_ENUM_MAP_FILE */ static void trace_insert_enum_map(struct module *mod, - struct trace_enum_map **start, int len) + struct trace_eval_map **start, int len) { - struct trace_enum_map **map; + struct trace_eval_map **map; if (len <= 0) return; @@ -7732,8 +7732,8 @@ struct dentry *tracing_init_dentry(void) return NULL; } -extern struct trace_enum_map *__start_ftrace_eval_maps[]; -extern struct trace_enum_map *__stop_ftrace_eval_maps[]; +extern struct trace_eval_map *__start_ftrace_eval_maps[]; +extern struct trace_eval_map *__stop_ftrace_eval_maps[]; static void __init trace_enum_init(void) { diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 39fd77330aab..a9667297ae49 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -1773,10 +1773,10 @@ static inline const char *get_syscall_name(int syscall) #ifdef CONFIG_EVENT_TRACING void trace_event_init(void); -void trace_event_enum_update(struct trace_enum_map **map, int len); +void trace_event_enum_update(struct trace_eval_map **map, int len); #else static inline void __init trace_event_init(void) { } -static inline void trace_event_enum_update(struct trace_enum_map **map, int len) { } +static inline void trace_event_enum_update(struct trace_eval_map **map, int len) { } #endif extern struct trace_iterator *tracepoint_print_iter; diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index e7973e10398c..cf5b9aa4d732 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -2067,18 +2067,18 @@ __register_event(struct trace_event_call *call, struct module *mod) return 0; } -static char *enum_replace(char *ptr, struct trace_enum_map *map, int len) +static char *enum_replace(char *ptr, struct trace_eval_map *map, int len) { int rlen; int elen; /* Find the length of the enum value as a string */ - elen = snprintf(ptr, 0, "%ld", map->enum_value); + elen = snprintf(ptr, 0, "%ld", map->eval_value); /* Make sure there's enough room to replace the string with the value */ if (len < elen) return NULL; - snprintf(ptr, elen + 1, "%ld", map->enum_value); + snprintf(ptr, elen + 1, "%ld", map->eval_value); /* Get the rest of the string of ptr */ rlen = strlen(ptr + len); @@ -2090,11 +2090,11 @@ static char *enum_replace(char *ptr, struct trace_enum_map *map, int len) } static void update_event_printk(struct trace_event_call *call, - struct trace_enum_map *map) + struct trace_eval_map *map) { char *ptr; int quote = 0; - int len = strlen(map->enum_string); + int len = strlen(map->eval_string); for (ptr = call->print_fmt; *ptr; ptr++) { if (*ptr == '\\') { @@ -2125,7 +2125,7 @@ static void update_event_printk(struct trace_event_call *call, continue; } if (isalpha(*ptr) || *ptr == '_') { - if (strncmp(map->enum_string, ptr, len) == 0 && + if (strncmp(map->eval_string, ptr, len) == 0 && !isalnum(ptr[len]) && ptr[len] != '_') { ptr = enum_replace(ptr, map, len); /* Hmm, enum string smaller than value */ @@ -2165,7 +2165,7 @@ static void update_event_printk(struct trace_event_call *call, } } -void trace_event_enum_update(struct trace_enum_map **map, int len) +void trace_event_enum_update(struct trace_eval_map **map, int len) { struct trace_event_call *call, *p; const char *last_system = NULL; From patchwork Thu Jun 15 10:52:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 105638 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp741131qgd; Thu, 15 Jun 2017 03:55:12 -0700 (PDT) X-Received: by 10.101.70.193 with SMTP id n1mr4739519pgr.249.1497524111914; Thu, 15 Jun 2017 03:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497524111; cv=none; d=google.com; s=arc-20160816; b=mLiAzir9D5XUX5V+Yw+DoLDiBM2E+U5SqlRabR5Jkt3ahxSA/KIzSpAIzyAd75Vc1t I8UDG6EZyGXj825cyF+TD1B92BzEnx+xuojawl0vNMKl8CiRmGccsSK3yFPMve6DmuYy v4qx2T3JsLNEGkKkDD+ikA+sKCVSJvc4FKuIaR+z1Wri71//wdaqwNFeWszq0Zgpn7kf 2FQnsf/UlzcuDGnUlpobHTFI4G41b27dcWXOawA2Hv58PE9sidciY7zxnQgxEfvs8r7W 8SlwneUa6RMi0ZLSW5ekh4B/JuWVTGIJGcLIqOaHZRM5aBQaQXlMcHNL8LvvUXr3rH9H o6aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :dmarc-filter:arc-authentication-results; bh=YZWWKtm2XWf1shpgkRabxRr1UJw4+yCbGThDHrQG+XI=; b=ozV/cqnXZHsB77MQpA1Gq7tuq6aoelMZflY/+EN5u28EN/21iWYIEGU3yB089XiKOA EyV3oYHqKpyeEIL4s2SItwMUQtaz5+Ak4pkLXKrfaEqD0vSsAphoc+e3rfOyZeKvzi42 zL/oeQsjGy0ruWWC8NxBAX/JwLyBSQmFkT4eZ7Pn8/UKCqM4T1k5CdrGugQOfaSv6Pn+ EgrbXdhOMRBAlCW5o6aa/v1hIU27IDuwm/WG6RkIfEMS3SCjyUcI+jgmPF89MeBe3t8c /ls2OfpCMxbmFJWjLHKaDT/sa+tRpPw7zo853yeV/R5QeC3u+D/pb5ISqBOh3GlOY9Ze xUaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j66si165586pfg.447.2017.06.15.03.55.11; Thu, 15 Jun 2017 03:55:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752701AbdFOKyx (ORCPT + 25 others); Thu, 15 Jun 2017 06:54:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:40536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751623AbdFOKwz (ORCPT ); Thu, 15 Jun 2017 06:52:55 -0400 Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C883239C3; Thu, 15 Jun 2017 10:52:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C883239C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Received: from rostedt by gandalf.local.home with local (Exim 4.87) (envelope-from ) id 1dLSOT-0003J7-7p; Thu, 15 Jun 2017 06:52:53 -0400 Message-Id: <20170615105253.167625738@goodmis.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Jun 2017 06:52:27 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jeremy Linton Subject: [for-next][PATCH 04/12] trace: rename struct module entry for trace enums References: <20170615105223.551999981@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline; filename=0004-trace-rename-struct-module-entry-for-trace-enums.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Linton Each module has a list of enum's its contributing to the enum map, rename that entry to reflect its use by more than enums. Link: http://lkml.kernel.org/r/20170531215653.3240-4-jeremy.linton@arm.com Signed-off-by: Jeremy Linton Signed-off-by: Steven Rostedt (VMware) --- include/linux/module.h | 4 ++-- kernel/module.c | 6 +++--- kernel/trace/trace.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) -- 2.10.2 diff --git a/include/linux/module.h b/include/linux/module.h index 46b48043d741..8eb9a1e693e5 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -442,8 +442,8 @@ struct module { #ifdef CONFIG_EVENT_TRACING struct trace_event_call **trace_events; unsigned int num_trace_events; - struct trace_eval_map **trace_enums; - unsigned int num_trace_enums; + struct trace_eval_map **trace_evals; + unsigned int num_trace_evals; #endif #ifdef CONFIG_FTRACE_MCOUNT_RECORD unsigned int num_ftrace_callsites; diff --git a/kernel/module.c b/kernel/module.c index 9ec4713c5eee..df1c4a9e7abb 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -3077,9 +3077,9 @@ static int find_module_sections(struct module *mod, struct load_info *info) mod->trace_events = section_objs(info, "_ftrace_events", sizeof(*mod->trace_events), &mod->num_trace_events); - mod->trace_enums = section_objs(info, "_ftrace_eval_map", - sizeof(*mod->trace_enums), - &mod->num_trace_enums); + mod->trace_evals = section_objs(info, "_ftrace_eval_map", + sizeof(*mod->trace_evals), + &mod->num_trace_evals); #endif #ifdef CONFIG_TRACING mod->trace_bprintk_fmt_start = section_objs(info, "__trace_printk_fmt", diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 46fac3f63af1..061abd8ba101 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -7746,7 +7746,7 @@ static void __init trace_enum_init(void) #ifdef CONFIG_MODULES static void trace_module_add_enums(struct module *mod) { - if (!mod->num_trace_enums) + if (!mod->num_trace_evals) return; /* @@ -7756,7 +7756,7 @@ static void trace_module_add_enums(struct module *mod) if (trace_module_has_bad_taint(mod)) return; - trace_insert_enum_map(mod, mod->trace_enums, mod->num_trace_enums); + trace_insert_enum_map(mod, mod->trace_evals, mod->num_trace_evals); } #ifdef CONFIG_TRACE_ENUM_MAP_FILE @@ -7765,7 +7765,7 @@ static void trace_module_remove_enums(struct module *mod) union trace_enum_map_item *map; union trace_enum_map_item **last = &trace_enum_maps; - if (!mod->num_trace_enums) + if (!mod->num_trace_evals) return; mutex_lock(&trace_enum_mutex); From patchwork Thu Jun 15 10:52:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 105640 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp741165qgd; Thu, 15 Jun 2017 03:55:17 -0700 (PDT) X-Received: by 10.98.67.86 with SMTP id q83mr4651630pfa.68.1497524117449; Thu, 15 Jun 2017 03:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497524117; cv=none; d=google.com; s=arc-20160816; b=H3WFZeaDRvtxo/+DLpWMX/Xm9C5QyNwLNEUaDX548GTZ1/LFhAFf8S+Ay1iUPZIAwO K+YRX2ilDxNMNcCVBc26SzWw74ql5xLeoMoN5l+0weLgmEancrZTdVzfZoCvhl9q9igX +0prbeTL2R119epNanhFbKAGnRXLxz9rNs5nW0NNfjEFBUvWIaP21cYfcN2jwe0YY5pq Xm422gEwMiNybbM3IHkboz24fxQUf/ZKWPzOJThMeSMj10Rwtylq429eoaSTTHWS71iV SGUD1CJm1GE1HZp4dtBO/XZP18ip9AO4V27eCBbZB++Jv62XGAa3MEAYdxleinR/pKQd MJnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :dmarc-filter:arc-authentication-results; bh=z3ht7YrtMFGQazmeBshS9ccyYS73cQONbkXdiDO9TnQ=; b=QyQ+iFP5YIN43U6hHg/TqVRECENAuH3CDlSycNlcHmNJ6JJAIn2j/y2Xb9eVpq5eWp ubPlS27PVYleHDhmQf8A8jSZy1TgyJHkLZAWjTQxhDEVz4/aA+bGeUraVKfjSC1B3e5Q +ylr80RqNsVnSTpVM5dMkulVPciIwQtlYHCCTGyTcQRFK+oY3RPDuPwbTKKDZmsI+BSu vAGa+FHEPO67E7bUxIgrtNGgCImeAAhFd+4hFHhBTTPsgKpOsZL2Ir6PoOFfTZi86EqN NN9Uh1h0pGuqYhL5JK3iK1u5zMVHAJoEI4cymEOpB6zpkuT0RFgf9XWAdD7RU/AjleZ+ ZF6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j66si165586pfg.447.2017.06.15.03.55.17; Thu, 15 Jun 2017 03:55:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752669AbdFOKyv (ORCPT + 25 others); Thu, 15 Jun 2017 06:54:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:40570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752008AbdFOKwz (ORCPT ); Thu, 15 Jun 2017 06:52:55 -0400 Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9DEA2239E0; Thu, 15 Jun 2017 10:52:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DEA2239E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Received: from rostedt by gandalf.local.home with local (Exim 4.87) (envelope-from ) id 1dLSOT-0003Je-DH; Thu, 15 Jun 2017 06:52:53 -0400 Message-Id: <20170615105253.340430626@goodmis.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Jun 2017 06:52:28 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jeremy Linton Subject: [for-next][PATCH 05/12] trace: rename trace enum data structures in trace.c References: <20170615105223.551999981@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline; filename=0005-trace-rename-trace-enum-data-structures-in-trace.c.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Linton The enum map entries can be exported to userspace via a sys enum_map file. Rename those functions and structures to reflect the fact that we are using them for more than enums. Link: http://lkml.kernel.org/r/20170531215653.3240-5-jeremy.linton@arm.com Signed-off-by: Jeremy Linton Signed-off-by: Steven Rostedt (VMware) --- kernel/trace/trace.c | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) -- 2.10.2 diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 061abd8ba101..13c81f4f2bd7 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -122,38 +122,38 @@ int __disable_trace_on_warning; #ifdef CONFIG_TRACE_ENUM_MAP_FILE /* Map of enums to their values, for "enum_map" file */ -struct trace_enum_map_head { +struct trace_eval_map_head { struct module *mod; unsigned long length; }; -union trace_enum_map_item; +union trace_eval_map_item; -struct trace_enum_map_tail { +struct trace_eval_map_tail { /* * "end" is first and points to NULL as it must be different * than "mod" or "eval_string" */ - union trace_enum_map_item *next; + union trace_eval_map_item *next; const char *end; /* points to NULL */ }; static DEFINE_MUTEX(trace_enum_mutex); /* - * The trace_enum_maps are saved in an array with two extra elements, + * The trace_eval_maps are saved in an array with two extra elements, * one at the beginning, and one at the end. The beginning item contains * the count of the saved maps (head.length), and the module they * belong to if not built in (head.mod). The ending item contains a * pointer to the next array of saved enum_map items. */ -union trace_enum_map_item { +union trace_eval_map_item { struct trace_eval_map map; - struct trace_enum_map_head head; - struct trace_enum_map_tail tail; + struct trace_eval_map_head head; + struct trace_eval_map_tail tail; }; -static union trace_enum_map_item *trace_enum_maps; +static union trace_eval_map_item *trace_eval_maps; #endif /* CONFIG_TRACE_ENUM_MAP_FILE */ static int tracing_set_tracer(struct trace_array *tr, const char *buf); @@ -4745,8 +4745,8 @@ static const struct file_operations tracing_saved_cmdlines_size_fops = { }; #ifdef CONFIG_TRACE_ENUM_MAP_FILE -static union trace_enum_map_item * -update_enum_map(union trace_enum_map_item *ptr) +static union trace_eval_map_item * +update_enum_map(union trace_eval_map_item *ptr) { if (!ptr->map.eval_string) { if (ptr->tail.next) { @@ -4761,7 +4761,7 @@ update_enum_map(union trace_enum_map_item *ptr) static void *enum_map_next(struct seq_file *m, void *v, loff_t *pos) { - union trace_enum_map_item *ptr = v; + union trace_eval_map_item *ptr = v; /* * Paranoid! If ptr points to end, we don't want to increment past it. @@ -4782,12 +4782,12 @@ static void *enum_map_next(struct seq_file *m, void *v, loff_t *pos) static void *enum_map_start(struct seq_file *m, loff_t *pos) { - union trace_enum_map_item *v; + union trace_eval_map_item *v; loff_t l = 0; mutex_lock(&trace_enum_mutex); - v = trace_enum_maps; + v = trace_eval_maps; if (v) v++; @@ -4805,7 +4805,7 @@ static void enum_map_stop(struct seq_file *m, void *v) static int enum_map_show(struct seq_file *m, void *v) { - union trace_enum_map_item *ptr = v; + union trace_eval_map_item *ptr = v; seq_printf(m, "%s %ld (%s)\n", ptr->map.eval_string, ptr->map.eval_value, @@ -4836,8 +4836,8 @@ static const struct file_operations tracing_enum_map_fops = { .release = seq_release, }; -static inline union trace_enum_map_item * -trace_enum_jmp_to_tail(union trace_enum_map_item *ptr) +static inline union trace_eval_map_item * +trace_enum_jmp_to_tail(union trace_eval_map_item *ptr) { /* Return tail of array given the head */ return ptr + ptr->head.length + 1; @@ -4849,13 +4849,13 @@ trace_insert_enum_map_file(struct module *mod, struct trace_eval_map **start, { struct trace_eval_map **stop; struct trace_eval_map **map; - union trace_enum_map_item *map_array; - union trace_enum_map_item *ptr; + union trace_eval_map_item *map_array; + union trace_eval_map_item *ptr; stop = start + len; /* - * The trace_enum_maps contains the map plus a head and tail item, + * The trace_eval_maps contains the map plus a head and tail item, * where the head holds the module and length of array, and the * tail holds a pointer to the next list. */ @@ -4867,10 +4867,10 @@ trace_insert_enum_map_file(struct module *mod, struct trace_eval_map **start, mutex_lock(&trace_enum_mutex); - if (!trace_enum_maps) - trace_enum_maps = map_array; + if (!trace_eval_maps) + trace_eval_maps = map_array; else { - ptr = trace_enum_maps; + ptr = trace_eval_maps; for (;;) { ptr = trace_enum_jmp_to_tail(ptr); if (!ptr->tail.next) @@ -7762,15 +7762,15 @@ static void trace_module_add_enums(struct module *mod) #ifdef CONFIG_TRACE_ENUM_MAP_FILE static void trace_module_remove_enums(struct module *mod) { - union trace_enum_map_item *map; - union trace_enum_map_item **last = &trace_enum_maps; + union trace_eval_map_item *map; + union trace_eval_map_item **last = &trace_eval_maps; if (!mod->num_trace_evals) return; mutex_lock(&trace_enum_mutex); - map = trace_enum_maps; + map = trace_eval_maps; while (map) { if (map->head.mod == mod) From patchwork Thu Jun 15 10:52:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 105641 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp741324qgd; Thu, 15 Jun 2017 03:55:47 -0700 (PDT) X-Received: by 10.84.218.76 with SMTP id f12mr5429455plm.269.1497524147329; Thu, 15 Jun 2017 03:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497524147; cv=none; d=google.com; s=arc-20160816; b=CN9GKgEmn0yL2sacUw4A5fXzF4Ky1Dv/CVnJusIHoTrqS+hWc6emIy9lCUOciifjFX oo3YvaLwX4+W1EjbcH00DKDB+ywfVAkL51yfuJIePat3xx6denhvL6F2EcnWKJTcK1q7 3k1kQFnayr5pSd1T7MRGM+5yaVNIEGmxIMEJxMPgZtWGu297VZTCB+EScvtdtEpXFioW XomFJ9R85WebLn5zaEbMaB5Lxs6VMNihOXK/q3FUp8ar/vbzmSiHobqZns+x/vxHpA7v gJ6zQceF2dqV9yUHPmbQAiFZbvKzXMHc6r74arRwErB6bz/DLL7KcxdHu0D6Cm0yKUmv efFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :dmarc-filter:arc-authentication-results; bh=BS7WyyhG5v2Tlj0gT4yfCO5an3dxxzgeVVOXcu4srNU=; b=MrHhSRFpVNpRTY4a3aQua79IhzVD86BqROsoWD0KXPG3WSteA3C6NEL40kyo6lE58i x6qNuUoqUrRSjPHtwelKY3SrQh9Bzxxw2CFwU0Re4a5vlq03VpKUIXYyE8qOPsEL5FpT OWJkCxsTaYbory+Mc4m9rC+KRoYY25MDPPlTtkF/AqeUX5fZRYtCDu3jRINEgN5fhohk cBbLWPx9MTrhDWaOGhZsynUM0zSZP/A/eheEJHmEX5HL3Rpk6M95hDGwnoFRO4dvALDT TsnVUGDgC/3OZjCKJiR15PqHSHuMvnG+JN9Iaz3zP1ZiAbHgioQgtZJFOGBgwqqdiPbZ urYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p184si2061020pfp.90.2017.06.15.03.55.47; Thu, 15 Jun 2017 03:55:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752655AbdFOKyu (ORCPT + 25 others); Thu, 15 Jun 2017 06:54:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:40574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752053AbdFOKwz (ORCPT ); Thu, 15 Jun 2017 06:52:55 -0400 Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC652239E2; Thu, 15 Jun 2017 10:52:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC652239E2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Received: from rostedt by gandalf.local.home with local (Exim 4.87) (envelope-from ) id 1dLSOT-0003KB-KI; Thu, 15 Jun 2017 06:52:53 -0400 Message-Id: <20170615105253.537390734@goodmis.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Jun 2017 06:52:29 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jeremy Linton Subject: [for-next][PATCH 06/12] trace: rename trace_enum_mutex to trace_eval_mutex References: <20170615105223.551999981@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline; filename=0006-trace-rename-trace_enum_mutex-to-trace_eval_mutex.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Linton There is a lock protecting the trace_enum_map, rename it to reflect the use by more than enums. Link: http://lkml.kernel.org/r/20170531215653.3240-6-jeremy.linton@arm.com Signed-off-by: Jeremy Linton Signed-off-by: Steven Rostedt (VMware) --- kernel/trace/trace.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.10.2 diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 13c81f4f2bd7..e0279f5dc83f 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -138,7 +138,7 @@ struct trace_eval_map_tail { const char *end; /* points to NULL */ }; -static DEFINE_MUTEX(trace_enum_mutex); +static DEFINE_MUTEX(trace_eval_mutex); /* * The trace_eval_maps are saved in an array with two extra elements, @@ -4785,7 +4785,7 @@ static void *enum_map_start(struct seq_file *m, loff_t *pos) union trace_eval_map_item *v; loff_t l = 0; - mutex_lock(&trace_enum_mutex); + mutex_lock(&trace_eval_mutex); v = trace_eval_maps; if (v) @@ -4800,7 +4800,7 @@ static void *enum_map_start(struct seq_file *m, loff_t *pos) static void enum_map_stop(struct seq_file *m, void *v) { - mutex_unlock(&trace_enum_mutex); + mutex_unlock(&trace_eval_mutex); } static int enum_map_show(struct seq_file *m, void *v) @@ -4865,7 +4865,7 @@ trace_insert_enum_map_file(struct module *mod, struct trace_eval_map **start, return; } - mutex_lock(&trace_enum_mutex); + mutex_lock(&trace_eval_mutex); if (!trace_eval_maps) trace_eval_maps = map_array; @@ -4890,7 +4890,7 @@ trace_insert_enum_map_file(struct module *mod, struct trace_eval_map **start, } memset(map_array, 0, sizeof(*map_array)); - mutex_unlock(&trace_enum_mutex); + mutex_unlock(&trace_eval_mutex); } static void trace_create_enum_file(struct dentry *d_tracer) @@ -7768,7 +7768,7 @@ static void trace_module_remove_enums(struct module *mod) if (!mod->num_trace_evals) return; - mutex_lock(&trace_enum_mutex); + mutex_lock(&trace_eval_mutex); map = trace_eval_maps; @@ -7785,7 +7785,7 @@ static void trace_module_remove_enums(struct module *mod) *last = trace_enum_jmp_to_tail(map)->tail.next; kfree(map); out: - mutex_unlock(&trace_enum_mutex); + mutex_unlock(&trace_eval_mutex); } #else static inline void trace_module_remove_enums(struct module *mod) { } From patchwork Thu Jun 15 10:52:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 105637 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp740963qgd; Thu, 15 Jun 2017 03:54:41 -0700 (PDT) X-Received: by 10.84.184.12 with SMTP id l12mr5583695plc.296.1497524081227; Thu, 15 Jun 2017 03:54:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497524081; cv=none; d=google.com; s=arc-20160816; b=vNl7yQ9PuOmZk6SppOND7QgnU6VtGfejtrpBD+SD7uDpn/QDbbCDNoMUhDuaCooPLj vsCsngMT69WPRAsplUw0tqQM6MMvtHVAJjpWlbuu2JwGV3yxMTfxPRnj6JGFfYU/+DnF lhKAFZ7ZBq73Yr9ZO5cY9/WMsW/i6idCaw8aCiMgqTSzjMsm+YnwckRZaUnhG7cC+p8I unQw9AwawjQRq9o+NKlOtEjLbWd76ycB7b6oKFPAYRpXjtSsHLZy2do9PbdIsydtH7Nw CrM/9u35W4vWca8/Y1bMScmQk3Pf0NV66CFoWmr3o5n+nLIGK40XtlCWMhESm0tPbCTS FHuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :dmarc-filter:arc-authentication-results; bh=iiwSl+cpoMIk5MriKOzKBan9I1monrQzXqE8v+Wy3LQ=; b=dbG6M1wlxh8D4TTzhfLI/o+E1m27FqzEY0xu2advGmgtbwaLmjjke9VN72C/9g2ENR irz+Q7ewb6G9c/Yx7aL3lKkPZt2Ba645F6wqvmUrZzp9dTWpDCmBfz6dAhl9SjWkDB8e UnOuy/TJP3z2X5+rnIZuzSBIAq+p6yBexhv2uUd9osIza/QtYGqnSrP6rEKnFJszB6Hh TbI/pi8ctE/PKU9miHgeZY4g6hn2XO7qH9QvaGOUYpAyDdHvxmzFV7839/d5ampW9RkB zDkHMaUkfrbidqx+10EySb+XBc44siy4TUHKtIXVWLI9ZqbPIjTjbjGiD4qQWts3+2BY 5SUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j19si416558pgn.452.2017.06.15.03.54.40; Thu, 15 Jun 2017 03:54:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752642AbdFOKyh (ORCPT + 25 others); Thu, 15 Jun 2017 06:54:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:40586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751829AbdFOKwz (ORCPT ); Thu, 15 Jun 2017 06:52:55 -0400 Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D8B27239B6; Thu, 15 Jun 2017 10:52:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8B27239B6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Received: from rostedt by gandalf.local.home with local (Exim 4.87) (envelope-from ) id 1dLSOT-0003Ki-Ob; Thu, 15 Jun 2017 06:52:53 -0400 Message-Id: <20170615105253.693823548@goodmis.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Jun 2017 06:52:30 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jeremy Linton Subject: [for-next][PATCH 07/12] trace: rename trace.c enum functions References: <20170615105223.551999981@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline; filename=0007-trace-rename-trace.c-enum-functions.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Linton Rename the init and trace_enum_jmp_to_tail() routines to reflect their use by more than enumerated types. Link: http://lkml.kernel.org/r/20170531215653.3240-7-jeremy.linton@arm.com Signed-off-by: Jeremy Linton Signed-off-by: Steven Rostedt (VMware) --- kernel/trace/trace.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.10.2 diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index e0279f5dc83f..d703f429bbd9 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -4837,7 +4837,7 @@ static const struct file_operations tracing_enum_map_fops = { }; static inline union trace_eval_map_item * -trace_enum_jmp_to_tail(union trace_eval_map_item *ptr) +trace_eval_jmp_to_tail(union trace_eval_map_item *ptr) { /* Return tail of array given the head */ return ptr + ptr->head.length + 1; @@ -4872,7 +4872,7 @@ trace_insert_enum_map_file(struct module *mod, struct trace_eval_map **start, else { ptr = trace_eval_maps; for (;;) { - ptr = trace_enum_jmp_to_tail(ptr); + ptr = trace_eval_jmp_to_tail(ptr); if (!ptr->tail.next) break; ptr = ptr->tail.next; @@ -7735,7 +7735,7 @@ struct dentry *tracing_init_dentry(void) extern struct trace_eval_map *__start_ftrace_eval_maps[]; extern struct trace_eval_map *__stop_ftrace_eval_maps[]; -static void __init trace_enum_init(void) +static void __init trace_eval_init(void) { int len; @@ -7775,14 +7775,14 @@ static void trace_module_remove_enums(struct module *mod) while (map) { if (map->head.mod == mod) break; - map = trace_enum_jmp_to_tail(map); + map = trace_eval_jmp_to_tail(map); last = &map->tail.next; map = map->tail.next; } if (!map) goto out; - *last = trace_enum_jmp_to_tail(map)->tail.next; + *last = trace_eval_jmp_to_tail(map)->tail.next; kfree(map); out: mutex_unlock(&trace_eval_mutex); @@ -7839,7 +7839,7 @@ static __init int tracer_init_tracefs(void) trace_create_file("saved_cmdlines_size", 0644, d_tracer, NULL, &tracing_saved_cmdlines_size_fops); - trace_enum_init(); + trace_eval_init(); trace_create_enum_file(d_tracer); From patchwork Thu Jun 15 10:52:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 105636 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp740876qgd; Thu, 15 Jun 2017 03:54:26 -0700 (PDT) X-Received: by 10.99.60.30 with SMTP id j30mr4719724pga.18.1497524066571; Thu, 15 Jun 2017 03:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497524066; cv=none; d=google.com; s=arc-20160816; b=Y6EBLuRC0JMgIkEg/s2xErn2jfJsJ0iH1DR5NRlVVTiZSdXQm+AIhcDkfRFskjnQM9 ZaD96kfqiUqszJkvTyRpL9uiBS3l6A1U/d4QlHt7iiYNhXYZFHR8LjTNilmAl/BhcW96 FS2aKx11uxDRP+56nIwu7DkGxgh7OzP3ZrGoeMvf/SUH0m6wUCOa3u3K71hHbtUjO2Hi OiythOjc8WpIeoq3zuI6TPYW0CUdea7zRcFyYEPhayZ3Hi/iJeGRsryWNetxotypL1hO w2UBPv03bCzQ6qHkEoGGVb7Nm5GPFIRYgDwwJmCM/eOnc2T2Jjer9INS8DNmk/vXDOC2 dLXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :dmarc-filter:arc-authentication-results; bh=Rs5kpceH+BlywJo5mxrRT0fRDUOxLbMaHOdk8dd7Ue0=; b=i9zmPp7KB9/43CRgiy/Dq1Q7g8fJgJ062pkhxPAZRcoMSAan7Uj0o9LATcqgBsPah5 584/WJXr/mom7b2B4tTNBQ1XTWrPl3cYq56bZk4J9Ukq1L00CgowVgBtuRTmS+XXRyEM vNn5H3JZ3uY3pmubuN47fGURJpsQJgRMqdmCzeW43bDcn4BNQU//T0n+lNnwsn+PRiOS FgYbYE+08jGlKeV9EUNRRij7FZ2zKBI1nSqx/AG3zhcApjcr71Sx2zNYIKEO+Gt7Mrkg nL/GIkZ9hWYkYd22NUf3ev64LT7LmNOkoZGaVTPRA0jx6+6Xr+v4w3HJin/PDbSRk+Q6 M0qA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j19si416558pgn.452.2017.06.15.03.54.26; Thu, 15 Jun 2017 03:54:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752641AbdFOKyO (ORCPT + 25 others); Thu, 15 Jun 2017 06:54:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:40604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752092AbdFOKwz (ORCPT ); Thu, 15 Jun 2017 06:52:55 -0400 Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 375EB23A00; Thu, 15 Jun 2017 10:52:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 375EB23A00 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Received: from rostedt by gandalf.local.home with local (Exim 4.87) (envelope-from ) id 1dLSOT-0003LF-TE; Thu, 15 Jun 2017 06:52:53 -0400 Message-Id: <20170615105253.827051072@goodmis.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Jun 2017 06:52:31 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jeremy Linton Subject: [for-next][PATCH 08/12] trace: rename enum_map functions References: <20170615105223.551999981@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline; filename=0008-trace-rename-enum_map-functions.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Linton Rename the core trace enum routines to use eval, to reflect their use by more than just enum to value mapping. Link: http://lkml.kernel.org/r/20170531215653.3240-8-jeremy.linton@arm.com Signed-off-by: Jeremy Linton Signed-off-by: Steven Rostedt (VMware) --- kernel/trace/trace.c | 74 ++++++++++++++++++++++----------------------- kernel/trace/trace.h | 4 +-- kernel/trace/trace_events.c | 2 +- 3 files changed, 40 insertions(+), 40 deletions(-) -- 2.10.2 diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index d703f429bbd9..d830be7f0ba6 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -145,7 +145,7 @@ static DEFINE_MUTEX(trace_eval_mutex); * one at the beginning, and one at the end. The beginning item contains * the count of the saved maps (head.length), and the module they * belong to if not built in (head.mod). The ending item contains a - * pointer to the next array of saved enum_map items. + * pointer to the next array of saved enum_eval/enum_map items. */ union trace_eval_map_item { struct trace_eval_map map; @@ -1141,9 +1141,9 @@ unsigned long nsecs_to_usecs(unsigned long nsecs) /* * TRACE_FLAGS is defined as a tuple matching bit masks with strings. - * It uses C(a, b) where 'a' is the enum name and 'b' is the string that + * It uses C(a, b) where 'a' is the eval (enum) name and 'b' is the string that * matches it. By defining "C(a, b) b", TRACE_FLAGS becomes a list - * of strings in the order that the enums were defined. + * of strings in the order that the evals (enum) were defined. */ #undef C #define C(a, b) b @@ -4746,7 +4746,7 @@ static const struct file_operations tracing_saved_cmdlines_size_fops = { #ifdef CONFIG_TRACE_ENUM_MAP_FILE static union trace_eval_map_item * -update_enum_map(union trace_eval_map_item *ptr) +update_eval_map(union trace_eval_map_item *ptr) { if (!ptr->map.eval_string) { if (ptr->tail.next) { @@ -4759,7 +4759,7 @@ update_enum_map(union trace_eval_map_item *ptr) return ptr; } -static void *enum_map_next(struct seq_file *m, void *v, loff_t *pos) +static void *eval_map_next(struct seq_file *m, void *v, loff_t *pos) { union trace_eval_map_item *ptr = v; @@ -4767,7 +4767,7 @@ static void *enum_map_next(struct seq_file *m, void *v, loff_t *pos) * Paranoid! If ptr points to end, we don't want to increment past it. * This really should never happen. */ - ptr = update_enum_map(ptr); + ptr = update_eval_map(ptr); if (WARN_ON_ONCE(!ptr)) return NULL; @@ -4775,12 +4775,12 @@ static void *enum_map_next(struct seq_file *m, void *v, loff_t *pos) (*pos)++; - ptr = update_enum_map(ptr); + ptr = update_eval_map(ptr); return ptr; } -static void *enum_map_start(struct seq_file *m, loff_t *pos) +static void *eval_map_start(struct seq_file *m, loff_t *pos) { union trace_eval_map_item *v; loff_t l = 0; @@ -4792,18 +4792,18 @@ static void *enum_map_start(struct seq_file *m, loff_t *pos) v++; while (v && l < *pos) { - v = enum_map_next(m, v, &l); + v = eval_map_next(m, v, &l); } return v; } -static void enum_map_stop(struct seq_file *m, void *v) +static void eval_map_stop(struct seq_file *m, void *v) { mutex_unlock(&trace_eval_mutex); } -static int enum_map_show(struct seq_file *m, void *v) +static int eval_map_show(struct seq_file *m, void *v) { union trace_eval_map_item *ptr = v; @@ -4814,23 +4814,23 @@ static int enum_map_show(struct seq_file *m, void *v) return 0; } -static const struct seq_operations tracing_enum_map_seq_ops = { - .start = enum_map_start, - .next = enum_map_next, - .stop = enum_map_stop, - .show = enum_map_show, +static const struct seq_operations tracing_eval_map_seq_ops = { + .start = eval_map_start, + .next = eval_map_next, + .stop = eval_map_stop, + .show = eval_map_show, }; -static int tracing_enum_map_open(struct inode *inode, struct file *filp) +static int tracing_eval_map_open(struct inode *inode, struct file *filp) { if (tracing_disabled) return -ENODEV; - return seq_open(filp, &tracing_enum_map_seq_ops); + return seq_open(filp, &tracing_eval_map_seq_ops); } -static const struct file_operations tracing_enum_map_fops = { - .open = tracing_enum_map_open, +static const struct file_operations tracing_eval_map_fops = { + .open = tracing_eval_map_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, @@ -4844,7 +4844,7 @@ trace_eval_jmp_to_tail(union trace_eval_map_item *ptr) } static void -trace_insert_enum_map_file(struct module *mod, struct trace_eval_map **start, +trace_insert_eval_map_file(struct module *mod, struct trace_eval_map **start, int len) { struct trace_eval_map **stop; @@ -4861,7 +4861,7 @@ trace_insert_enum_map_file(struct module *mod, struct trace_eval_map **start, */ map_array = kmalloc(sizeof(*map_array) * (len + 2), GFP_KERNEL); if (!map_array) { - pr_warn("Unable to allocate trace enum mapping\n"); + pr_warn("Unable to allocate trace eval mapping\n"); return; } @@ -4893,19 +4893,19 @@ trace_insert_enum_map_file(struct module *mod, struct trace_eval_map **start, mutex_unlock(&trace_eval_mutex); } -static void trace_create_enum_file(struct dentry *d_tracer) +static void trace_create_eval_file(struct dentry *d_tracer) { trace_create_file("enum_map", 0444, d_tracer, - NULL, &tracing_enum_map_fops); + NULL, &tracing_eval_map_fops); } #else /* CONFIG_TRACE_ENUM_MAP_FILE */ -static inline void trace_create_enum_file(struct dentry *d_tracer) { } -static inline void trace_insert_enum_map_file(struct module *mod, +static inline void trace_create_eval_file(struct dentry *d_tracer) { } +static inline void trace_insert_eval_map_file(struct module *mod, struct trace_eval_map **start, int len) { } #endif /* !CONFIG_TRACE_ENUM_MAP_FILE */ -static void trace_insert_enum_map(struct module *mod, +static void trace_insert_eval_map(struct module *mod, struct trace_eval_map **start, int len) { struct trace_eval_map **map; @@ -4915,9 +4915,9 @@ static void trace_insert_enum_map(struct module *mod, map = start; - trace_event_enum_update(map, len); + trace_event_eval_update(map, len); - trace_insert_enum_map_file(mod, start, len); + trace_insert_eval_map_file(mod, start, len); } static ssize_t @@ -7740,11 +7740,11 @@ static void __init trace_eval_init(void) int len; len = __stop_ftrace_eval_maps - __start_ftrace_eval_maps; - trace_insert_enum_map(NULL, __start_ftrace_eval_maps, len); + trace_insert_eval_map(NULL, __start_ftrace_eval_maps, len); } #ifdef CONFIG_MODULES -static void trace_module_add_enums(struct module *mod) +static void trace_module_add_evals(struct module *mod) { if (!mod->num_trace_evals) return; @@ -7756,11 +7756,11 @@ static void trace_module_add_enums(struct module *mod) if (trace_module_has_bad_taint(mod)) return; - trace_insert_enum_map(mod, mod->trace_evals, mod->num_trace_evals); + trace_insert_eval_map(mod, mod->trace_evals, mod->num_trace_evals); } #ifdef CONFIG_TRACE_ENUM_MAP_FILE -static void trace_module_remove_enums(struct module *mod) +static void trace_module_remove_evals(struct module *mod) { union trace_eval_map_item *map; union trace_eval_map_item **last = &trace_eval_maps; @@ -7788,7 +7788,7 @@ static void trace_module_remove_enums(struct module *mod) mutex_unlock(&trace_eval_mutex); } #else -static inline void trace_module_remove_enums(struct module *mod) { } +static inline void trace_module_remove_evals(struct module *mod) { } #endif /* CONFIG_TRACE_ENUM_MAP_FILE */ static int trace_module_notify(struct notifier_block *self, @@ -7798,10 +7798,10 @@ static int trace_module_notify(struct notifier_block *self, switch (val) { case MODULE_STATE_COMING: - trace_module_add_enums(mod); + trace_module_add_evals(mod); break; case MODULE_STATE_GOING: - trace_module_remove_enums(mod); + trace_module_remove_evals(mod); break; } @@ -7841,7 +7841,7 @@ static __init int tracer_init_tracefs(void) trace_eval_init(); - trace_create_enum_file(d_tracer); + trace_create_eval_file(d_tracer); #ifdef CONFIG_MODULES register_module_notifier(&trace_module_nb); diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index a9667297ae49..69a3ab3ee4f5 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -1773,10 +1773,10 @@ static inline const char *get_syscall_name(int syscall) #ifdef CONFIG_EVENT_TRACING void trace_event_init(void); -void trace_event_enum_update(struct trace_eval_map **map, int len); +void trace_event_eval_update(struct trace_eval_map **map, int len); #else static inline void __init trace_event_init(void) { } -static inline void trace_event_enum_update(struct trace_eval_map **map, int len) { } +static inline void trace_event_eval_update(struct trace_eval_map **map, int len) { } #endif extern struct trace_iterator *tracepoint_print_iter; diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index cf5b9aa4d732..e6897b005947 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -2165,7 +2165,7 @@ static void update_event_printk(struct trace_event_call *call, } } -void trace_event_enum_update(struct trace_eval_map **map, int len) +void trace_event_eval_update(struct trace_eval_map **map, int len) { struct trace_event_call *call, *p; const char *last_system = NULL; From patchwork Thu Jun 15 10:52:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 105635 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp740873qgd; Thu, 15 Jun 2017 03:54:26 -0700 (PDT) X-Received: by 10.101.87.206 with SMTP id q14mr4619777pgr.153.1497524066145; Thu, 15 Jun 2017 03:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497524066; cv=none; d=google.com; s=arc-20160816; b=iS3cjqPmupb1H6JiS20To/LHgaEHqlu3fCNBdZK0VZAGx6rneOX8HHt9cVMGTewLPg KOZW9CAcm3FqOvX9EL8Q7Xygeevroiw+HvfMV7Ii4ko5UwjEonX/1FWSBiuD/Z9xjuFv lcwxzYDT+wCyRNstU7UBJgWaQhyTeqE2AS4vgzc/jzDK6DOHyqNzzju5oG2ldaTUYH6D jJj8zqHrUA2whCQaGQRN3YNPGRVYylyBCSIiIGLKKTajT4/Iwl119z53rBvg34ihycu7 mSoo0/paGnY+XcAdPMcOs2Kolv3G2UGDE8mFGk4YAfpgg0cCXX/VcIE2D2Xz75HDDjda rOSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :dmarc-filter:arc-authentication-results; bh=YxJFzK03Sz8E3XhyLHtzYJBmOEcgwoA5rDCD+turnw8=; b=g8YOfZTDCMWgWd5gLznQkH+jSNPHMxBSsCIxkkLEbOMG8m3IjgBa4kFnBA44sEaWL6 ec6HROFvwwau3zlAOZrWTCuy/gtMPSgTynrLtkiDxtuM4jIgr6zKZnI501Reh/vGJf0a d7aUElyiJGkyhr1C0s5jaHAwKnYhxFfB2gjGcTkYKBblsophS1ZLBmRh+I43PgZomEFf IdtPE+mdXWoRj8L8nG1IgWiKXaclCZKLnWy8NWOtzavVh0xoYHVZoofUwCmOXKf6rtLQ KEkUJoO/0bTt9WwKNvJGxHV5eACAGkad89TY/FCufdhLTV/5axNuE8qMh0SHQh1Sq2el U2+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j19si416558pgn.452.2017.06.15.03.54.25; Thu, 15 Jun 2017 03:54:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752619AbdFOKyN (ORCPT + 25 others); Thu, 15 Jun 2017 06:54:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:40600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752105AbdFOKwz (ORCPT ); Thu, 15 Jun 2017 06:52:55 -0400 Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 361D5239F4; Thu, 15 Jun 2017 10:52:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 361D5239F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Received: from rostedt by gandalf.local.home with local (Exim 4.87) (envelope-from ) id 1dLSOU-0003Lm-2H; Thu, 15 Jun 2017 06:52:54 -0400 Message-Id: <20170615105254.004426284@goodmis.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Jun 2017 06:52:32 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jeremy Linton Subject: [for-next][PATCH 09/12] tracing: Rename enum_replace to eval_replace References: <20170615105223.551999981@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline; filename=0009-tracing-Rename-enum_replace-to-eval_replace.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Linton The enum_replace stanza works as is for sizeof() calls as well as enums. Rename it as well. Link: http://lkml.kernel.org/r/20170531215653.3240-9-jeremy.linton@arm.com Signed-off-by: Jeremy Linton Signed-off-by: Steven Rostedt (VMware) --- kernel/trace/trace_events.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.10.2 diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index e6897b005947..83dfd0dbbbfe 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -2067,12 +2067,12 @@ __register_event(struct trace_event_call *call, struct module *mod) return 0; } -static char *enum_replace(char *ptr, struct trace_eval_map *map, int len) +static char *eval_replace(char *ptr, struct trace_eval_map *map, int len) { int rlen; int elen; - /* Find the length of the enum value as a string */ + /* Find the length of the eval value as a string */ elen = snprintf(ptr, 0, "%ld", map->eval_value); /* Make sure there's enough room to replace the string with the value */ if (len < elen) @@ -2127,14 +2127,14 @@ static void update_event_printk(struct trace_event_call *call, if (isalpha(*ptr) || *ptr == '_') { if (strncmp(map->eval_string, ptr, len) == 0 && !isalnum(ptr[len]) && ptr[len] != '_') { - ptr = enum_replace(ptr, map, len); - /* Hmm, enum string smaller than value */ + ptr = eval_replace(ptr, map, len); + /* enum/sizeof string smaller than value */ if (WARN_ON_ONCE(!ptr)) return; /* - * No need to decrement here, as enum_replace() + * No need to decrement here, as eval_replace() * returns the pointer to the character passed - * the enum, and two enums can not be placed + * the eval, and two evals can not be placed * back to back without something in between. * We can skip that something in between. */ From patchwork Thu Jun 15 10:52:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 105631 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp740376qgd; Thu, 15 Jun 2017 03:53:03 -0700 (PDT) X-Received: by 10.84.175.132 with SMTP id t4mr5553214plb.18.1497523983665; Thu, 15 Jun 2017 03:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497523983; cv=none; d=google.com; s=arc-20160816; b=y7jl4V/CPKwpIoK6kp6KDYovy2DZCOOTLXvAJ5vneJiFOkxhvhRnzlxvi4iXysH9NT y6dhGbeLPQ7IwypAra/N9ArfRhPFTcoWUSCe6ZhpTaJA7Ej9d68TPxlMRnyGOasZRsZc zAaPZSsyqr8LotutOE6GoBTiAdNEgZpgqMKUe99xSoMA/V1iGBlkzPiwKL49TnMlOLDL 6v9feWV7YOZbvacf7zHX80r7L4lcsW/com+EJFawjtUhE+JmjCaciSc8c8O8dJkgdOW6 XJ/ZsHDHelCEWzdmhrT6dsXQCfbnQ2NXspe/o9HMIWTtbW99kpW4f3igGhrJudU2HOAa 4c/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :dmarc-filter:arc-authentication-results; bh=GvjxrSTXVdL+pEwhip/Vzb7hgfS1pHpmDls6MMKxZ1Q=; b=AyzkDTTApKC6mQ3+7Z+mlCsf7aIQtiNCzsLCVRX8iYKGOJ+wrRE9Sf4bCTxqKYfzeM HrfdavEW12aIfpOBk0cZTtpo/So+CFk8vYiXqmat+zUwHx2s/wHUrUHrAUnNqDLWzZfI 7oxIZhNYvRFm+iSCXIBtvuhqvhXYZMxpKDUJAQv/4JS5byglBf6GFl4LgZkgXsiDrHJF Zqef0K6FdOhkcxerGqXTumqhAZ710siUMI9dFZzLhLVsjn6DsMTa091/wK3iyXd/rhoB y+w8y3s1JMoPbBCICdLmndtlsCOkMJvFGzpJthgggYPu679YbMjdujM2I36ktO33bHFW 6vfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 34si2042624plz.544.2017.06.15.03.53.03; Thu, 15 Jun 2017 03:53:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752439AbdFOKxA (ORCPT + 25 others); Thu, 15 Jun 2017 06:53:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:40574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272AbdFOKw4 (ORCPT ); Thu, 15 Jun 2017 06:52:56 -0400 Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E9134239E3; Thu, 15 Jun 2017 10:52:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9134239E3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Received: from rostedt by gandalf.local.home with local (Exim 4.87) (envelope-from ) id 1dLSOU-0003MJ-7u; Thu, 15 Jun 2017 06:52:54 -0400 Message-Id: <20170615105254.144480148@goodmis.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Jun 2017 06:52:33 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jeremy Linton Subject: [for-next][PATCH 10/12] tracing: define TRACE_DEFINE_SIZEOF() macro to map sizeofs to their values References: <20170615105223.551999981@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline; filename=0010-tracing-define-TRACE_DEFINE_SIZEOF-macro-to-map-size.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Linton Perf has a problem that if sizeof() macros are used within TRACE_EVENT() macro's they end up in userspace as "sizeof(kernel structure)" which cannot properly be parsed. Add a macro which can forward this data through the eval_map for userspace utilization. Link: http://lkml.kernel.org/r/20170531215653.3240-10-jeremy.linton@arm.com Signed-off-by: Jeremy Linton Signed-off-by: Steven Rostedt (VMware) --- include/linux/tracepoint.h | 1 + include/trace/trace_events.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) -- 2.10.2 diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index f7b0f5525e46..a26ffbe09e71 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -88,6 +88,7 @@ extern void syscall_unregfunc(void); #define PARAMS(args...) args #define TRACE_DEFINE_ENUM(x) +#define TRACE_DEFINE_SIZEOF(x) #endif /* _LINUX_TRACEPOINT_H */ diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h index 49cce5fb54ee..3976fa1f6e42 100644 --- a/include/trace/trace_events.h +++ b/include/trace/trace_events.h @@ -46,6 +46,19 @@ TRACE_MAKE_SYSTEM_STR(); __attribute__((section("_ftrace_eval_map"))) \ *TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a +#undef TRACE_DEFINE_SIZEOF +#define TRACE_DEFINE_SIZEOF(a) \ + static struct trace_eval_map __used __initdata \ + __##TRACE_SYSTEM##_##a = \ + { \ + .system = TRACE_SYSTEM_STRING, \ + .eval_string = "sizeof(" #a ")", \ + .eval_value = sizeof(a) \ + }; \ + static struct trace_eval_map __used \ + __attribute__((section("_ftrace_eval_map"))) \ + *TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a + /* * DECLARE_EVENT_CLASS can be used to add a generic function * handlers for events. That is, if all events have the same @@ -158,6 +171,9 @@ TRACE_MAKE_SYSTEM_STR(); #undef TRACE_DEFINE_ENUM #define TRACE_DEFINE_ENUM(a) +#undef TRACE_DEFINE_SIZEOF +#define TRACE_DEFINE_SIZEOF(a) + #undef __field #define __field(type, item) From patchwork Thu Jun 15 10:52:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 105633 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp740691qgd; Thu, 15 Jun 2017 03:53:58 -0700 (PDT) X-Received: by 10.84.231.136 with SMTP id g8mr5643663plk.257.1497524038137; Thu, 15 Jun 2017 03:53:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497524038; cv=none; d=google.com; s=arc-20160816; b=i5eRTF9SrkfOnTwr2IhSOkEC3HSMo8ju7Ty+hJLUnJ+s2WEBVysDMWsQlhPFLxgtYF D6z6mEcByWr6L6wS2XCkjEUPf2NsnHzfJNEBjyQstBRW9Yirmhlq1thZXfOX9loL7Y5f O8wExK5P42H0kHtESjiVyqRxKr3uNUT86Riuo4NHN5iULJvP//eHFUXy/t88zELjL0NR S0b9Exyg3UXeTqsSbeAWHJbSka/E/IH59aNVf450VMQeXWqgJJ0mW14IXAq5ruzKoHzi 1uWStx5zT/FNU9NjxKtpciSc9eFwbLXwWS8X/OnsSZWlo3ihFYXKUD/4RD6w8seiKmFn f5dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :dmarc-filter:arc-authentication-results; bh=S3RsaFBxIA+ILDnTTZzadLpKzU29YD5Hi9TvH/YjsDw=; b=qAYRPbuyOnhJt7RnB7bRpZKLzzau3N4f0BNWV3OQa4b9zPjuJxudfVAX3cE8l3f79u THV8eq0XVljqR8fuY5/A65+f78/6f5d4rd0Aw3BAgKso/8bxrnVry8S/A2aZ0pimuf7p rxmOgUCck8D5Ow2dvQ8Mt1zkWBwQjoBW1nCy9l2DkNvEkF8HV/z1ouHy+RLfrCTGytA6 voHdbtk78V1WYzS7u3Lhb3//kEJO3Yts9DnBzSJ0eCu1F8w3LQzMOVsREz7alGwk5Kb9 aq4BBvz9+nvT2Sw8GKO7i9uBb0hVs1tQGbbdmg540jdFi5TbguusuMWx+/n1TU47aJ2g IuEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r21si2042810pgr.106.2017.06.15.03.53.57; Thu, 15 Jun 2017 03:53:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752570AbdFOKxe (ORCPT + 25 others); Thu, 15 Jun 2017 06:53:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:40638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752172AbdFOKw4 (ORCPT ); Thu, 15 Jun 2017 06:52:56 -0400 Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8757B239B5; Thu, 15 Jun 2017 10:52:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8757B239B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Received: from rostedt by gandalf.local.home with local (Exim 4.87) (envelope-from ) id 1dLSOU-0003Mq-C9; Thu, 15 Jun 2017 06:52:54 -0400 Message-Id: <20170615105254.308688727@goodmis.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Jun 2017 06:52:34 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jeremy Linton Subject: [for-next][PATCH 11/12] tracing: Add TRACE_DEFINE_SIZEOF() macros References: <20170615105223.551999981@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline; filename=0011-tracing-Add-TRACE_DEFINE_SIZEOF-macros.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Linton 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 ++ include/trace/events/xen.h | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) -- 2.10.2 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), diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h index 31acce9019a6..b70a38b7fa84 100644 --- a/include/trace/events/xen.h +++ b/include/trace/events/xen.h @@ -30,6 +30,8 @@ DECLARE_EVENT_CLASS(xen_mc__batch, DEFINE_XEN_MC_BATCH(xen_mc_batch); DEFINE_XEN_MC_BATCH(xen_mc_issue); +TRACE_DEFINE_SIZEOF(ulong); + TRACE_EVENT(xen_mc_entry, TP_PROTO(struct multicall_entry *mc, unsigned nargs), TP_ARGS(mc, nargs), @@ -40,8 +42,8 @@ TRACE_EVENT(xen_mc_entry, ), TP_fast_assign(__entry->op = mc->op; __entry->nargs = nargs; - memcpy(__entry->args, mc->args, sizeof(unsigned long) * nargs); - memset(__entry->args + nargs, 0, sizeof(unsigned long) * (6 - nargs)); + memcpy(__entry->args, mc->args, sizeof(ulong) * nargs); + memset(__entry->args + nargs, 0, sizeof(ulong) * (6 - nargs)); ), TP_printk("op %u%s args [%lx, %lx, %lx, %lx, %lx, %lx]", __entry->op, xen_hypercall_name(__entry->op), @@ -122,6 +124,7 @@ TRACE_EVENT(xen_mc_extend_args, __entry->res == XEN_MC_XE_NO_SPACE ? "NO_SPACE" : "???") ); +TRACE_DEFINE_SIZEOF(pteval_t); /* mmu */ DECLARE_EVENT_CLASS(xen_mmu__set_pte, TP_PROTO(pte_t *ptep, pte_t pteval), @@ -199,6 +202,8 @@ TRACE_EVENT(xen_mmu_pte_clear, __entry->mm, __entry->addr, __entry->ptep) ); +TRACE_DEFINE_SIZEOF(pmdval_t); + TRACE_EVENT(xen_mmu_set_pmd, TP_PROTO(pmd_t *pmdp, pmd_t pmdval), TP_ARGS(pmdp, pmdval), @@ -226,6 +231,8 @@ TRACE_EVENT(xen_mmu_pmd_clear, #if CONFIG_PGTABLE_LEVELS >= 4 +TRACE_DEFINE_SIZEOF(pudval_t); + TRACE_EVENT(xen_mmu_set_pud, TP_PROTO(pud_t *pudp, pud_t pudval), TP_ARGS(pudp, pudval), @@ -241,6 +248,8 @@ TRACE_EVENT(xen_mmu_set_pud, (int)sizeof(pudval_t) * 2, (unsigned long long)__entry->pudval) ); +TRACE_DEFINE_SIZEOF(p4dval_t); + TRACE_EVENT(xen_mmu_set_p4d, TP_PROTO(p4d_t *p4dp, p4d_t *user_p4dp, p4d_t p4dval), TP_ARGS(p4dp, user_p4dp, p4dval), From patchwork Thu Jun 15 10:52:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 105634 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp740695qgd; Thu, 15 Jun 2017 03:53:59 -0700 (PDT) X-Received: by 10.84.218.141 with SMTP id r13mr5377828pli.67.1497524039065; Thu, 15 Jun 2017 03:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497524039; cv=none; d=google.com; s=arc-20160816; b=KWvZ+HccPHbDG2nkGvY6ywc8S8De1isVGnX0GVSpgW9bDgFrUoEa6U6Nsu2Ot0vfrP UOZjCK98k2S0oC73Ng6xEPh2cF2Bn0lmoxmCm0YoUa89kkc96qx2W7iAzG/j38g/mwQK +PUL56eINK0RlDOX4q2gNDDML1y1JVKMSGVapQ8BQZC3uB4Zub7YC7voDJxE3tfi9Z3w NSvVL5toH4qq2LdKantliOurIiG7d7Ar7VVi0aI5xIsw5flmqNFdSXcMt1BCd/7FSdkq Niubc1Jrg+jvXtLCPxsHP6AcOPGwdbm9AsoT7WikyufUtx9/NcDpljexvyj/i9ZnbMJj +nkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :dmarc-filter:arc-authentication-results; bh=HSSTAqvPbqhiQ38tJ9ReDSiO0eVoxm0w2KsFUkk2vFQ=; b=IPlZMY0Ig9FAFTvibxwyLZ2owg5G+9BDkqw1hLoW1wM58V9E6xzqsoPzj4nftd8Pa6 jb6r62ZmkD97b/Ny3f0/d7mGrhJeinMDNsbxzDrOuhbLm67t8mzG5IZrhkfNCAQRhc94 8QXNaP7VARQvd6IvfWMligGWfp0JA6GpCuxKgpy9a1BqknJYHnsYw9QUAW+HB8JNSsfw ycj3wYeB40TKqMzOJS84V9KCNdT2U/WSYOcvv2eRgbK2jl35cCV47Nb4hWjcSSaAZIhu I5P3Xq12FCIz8aTSZh4AnTSxziFuOyPPiSK+wNxf1ZDIZjkme4FDrNTUHT9YPl29MnGT ftmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r21si2042810pgr.106.2017.06.15.03.53.58; Thu, 15 Jun 2017 03:53:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752548AbdFOKxd (ORCPT + 25 others); Thu, 15 Jun 2017 06:53:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:40570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752252AbdFOKw4 (ORCPT ); Thu, 15 Jun 2017 06:52:56 -0400 Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C72B8239CC; Thu, 15 Jun 2017 10:52:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C72B8239CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Received: from rostedt by gandalf.local.home with local (Exim 4.87) (envelope-from ) id 1dLSOU-0003NN-Hm; Thu, 15 Jun 2017 06:52:54 -0400 Message-Id: <20170615105254.467865927@goodmis.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Jun 2017 06:52:35 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jeremy Linton Subject: [for-next][PATCH 12/12] tracing: Rename update the enum_map file References: <20170615105223.551999981@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline; filename=0012-tracing-Rename-update-the-enum_map-file.patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Linton The enum_map file is used to display a list of symbol to name conversions. As its now used to resolve sizeof lets update the name and description. Link: http://lkml.kernel.org/r/20170531215653.3240-13-jeremy.linton@arm.com Signed-off-by: Jeremy Linton Signed-off-by: Steven Rostedt (VMware) --- kernel/trace/Kconfig | 22 +++++++++++----------- kernel/trace/trace.c | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) -- 2.10.2 diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 7e06f04e98fe..434c840e2d82 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -667,30 +667,30 @@ config RING_BUFFER_STARTUP_TEST If unsure, say N -config TRACE_ENUM_MAP_FILE - bool "Show enum mappings for trace events" +config TRACE_EVAL_MAP_FILE + bool "Show eval mappings for trace events" depends on TRACING help - The "print fmt" of the trace events will show the enum names instead - of their values. This can cause problems for user space tools that - use this string to parse the raw data as user space does not know + The "print fmt" of the trace events will show the enum/sizeof names + instead of their values. This can cause problems for user space tools + that use this string to parse the raw data as user space does not know how to convert the string to its value. To fix this, there's a special macro in the kernel that can be used - to convert the enum into its value. If this macro is used, then the - print fmt strings will have the enums converted to their values. + to convert an enum/sizeof into its value. If this macro is used, then + the print fmt strings will be converted to their values. If something does not get converted properly, this option can be - used to show what enums the kernel tried to convert. + used to show what enums/sizeof the kernel tried to convert. - This option is for debugging the enum conversions. A file is created - in the tracing directory called "enum_map" that will show the enum + This option is for debugging the conversions. A file is created + in the tracing directory called "eval_map" that will show the names matched with their values and what trace event system they belong too. Normally, the mapping of the strings to values will be freed after boot up or module load. With this option, they will not be freed, as - they are needed for the "enum_map" file. Enabling this option will + they are needed for the "eval_map" file. Enabling this option will increase the memory footprint of the running kernel. If unsure, say N diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index d830be7f0ba6..19ac2088d10a 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -120,8 +120,8 @@ enum ftrace_dump_mode ftrace_dump_on_oops; /* When set, tracing will stop when a WARN*() is hit */ int __disable_trace_on_warning; -#ifdef CONFIG_TRACE_ENUM_MAP_FILE -/* Map of enums to their values, for "enum_map" file */ +#ifdef CONFIG_TRACE_EVAL_MAP_FILE +/* Map of enums to their values, for "eval_map" file */ struct trace_eval_map_head { struct module *mod; unsigned long length; @@ -145,7 +145,7 @@ static DEFINE_MUTEX(trace_eval_mutex); * one at the beginning, and one at the end. The beginning item contains * the count of the saved maps (head.length), and the module they * belong to if not built in (head.mod). The ending item contains a - * pointer to the next array of saved enum_eval/enum_map items. + * pointer to the next array of saved eval_map items. */ union trace_eval_map_item { struct trace_eval_map map; @@ -154,7 +154,7 @@ union trace_eval_map_item { }; static union trace_eval_map_item *trace_eval_maps; -#endif /* CONFIG_TRACE_ENUM_MAP_FILE */ +#endif /* CONFIG_TRACE_EVAL_MAP_FILE */ static int tracing_set_tracer(struct trace_array *tr, const char *buf); @@ -4744,7 +4744,7 @@ static const struct file_operations tracing_saved_cmdlines_size_fops = { .write = tracing_saved_cmdlines_size_write, }; -#ifdef CONFIG_TRACE_ENUM_MAP_FILE +#ifdef CONFIG_TRACE_EVAL_MAP_FILE static union trace_eval_map_item * update_eval_map(union trace_eval_map_item *ptr) { @@ -4895,15 +4895,15 @@ trace_insert_eval_map_file(struct module *mod, struct trace_eval_map **start, static void trace_create_eval_file(struct dentry *d_tracer) { - trace_create_file("enum_map", 0444, d_tracer, + trace_create_file("eval_map", 0444, d_tracer, NULL, &tracing_eval_map_fops); } -#else /* CONFIG_TRACE_ENUM_MAP_FILE */ +#else /* CONFIG_TRACE_EVAL_MAP_FILE */ static inline void trace_create_eval_file(struct dentry *d_tracer) { } static inline void trace_insert_eval_map_file(struct module *mod, struct trace_eval_map **start, int len) { } -#endif /* !CONFIG_TRACE_ENUM_MAP_FILE */ +#endif /* !CONFIG_TRACE_EVAL_MAP_FILE */ static void trace_insert_eval_map(struct module *mod, struct trace_eval_map **start, int len) @@ -7759,7 +7759,7 @@ static void trace_module_add_evals(struct module *mod) trace_insert_eval_map(mod, mod->trace_evals, mod->num_trace_evals); } -#ifdef CONFIG_TRACE_ENUM_MAP_FILE +#ifdef CONFIG_TRACE_EVAL_MAP_FILE static void trace_module_remove_evals(struct module *mod) { union trace_eval_map_item *map; @@ -7789,7 +7789,7 @@ static void trace_module_remove_evals(struct module *mod) } #else static inline void trace_module_remove_evals(struct module *mod) { } -#endif /* CONFIG_TRACE_ENUM_MAP_FILE */ +#endif /* CONFIG_TRACE_EVAL_MAP_FILE */ static int trace_module_notify(struct notifier_block *self, unsigned long val, void *data)