From patchwork Wed Jun 14 22:27:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 105598 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp512076qgd; Wed, 14 Jun 2017 15:27:43 -0700 (PDT) X-Received: by 10.98.166.18 with SMTP id t18mr2079598pfe.66.1497479263030; Wed, 14 Jun 2017 15:27:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497479263; cv=none; d=google.com; s=arc-20160816; b=kO2LhyhQlB9dH3YfbssdT2J0pg+FFIVPg2Ia7NzqSt4xe6J2qkvLXy6CK5EUeQxC5+ 1aXNMlqjt6ZuBcrrTXj2Kgk1zPdKwHibm8oyvVW2QYtE3QhG/21ZfDlLJEC8NBko1eKk QkEO74IRDQAKDtZohhghePEeTLkYt135fFuKZj9h0zLeKwZshXdm8MxvplKbjb38utCt 1eFgNUF1PCt9dp2WzvmW0gTCS/zOVUPVvrjfKdxsTpyPGR2vPvIFKJcfiIrtMrAG3rPc 472z5mz9Kaz3y1xLP8wATTaD3PuCGja15YfbdNEcS2AhLSkO3eHTKMPgZ8EjonvTCRqF sg3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=qK9qPoAUEDhhWWaNWpWh8AdB2ZBsxjsBW5nESsFi4r4=; b=lRO18oiZtUCJFAd6OxdFDsNYX9CvVYJf0OoS5Hna2qBuS9dRbNe29/2kEBy5247zWO T7Jwmpc+cgr7ktzR8AB3P4YwRKeVPUwEciVof8ImWDBDTT/nuK34azmwrd76a0PF5qdw aY5ndoWreR2yipscpzJ3jOICQZR/tx8f68zmG/TYQHClP+VlWzlxgX2GPhWExGoKojw7 OQkNVQNyVcw7sx7QKzwLawd5MOJZl27/IB25IgjC8e8W+/YY3zC9FKJ8wwZE4kZP2eXH 6jWIziouXgy4AzX+8+wWsJrX+FcjmzacQIwUoONJPPI9RYuj6WWmewmotNBpzbiS2MRH rNPQ== 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 33si886660plh.539.2017.06.14.15.27.42; Wed, 14 Jun 2017 15:27:43 -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 S1752768AbdFNW1k (ORCPT + 25 others); Wed, 14 Jun 2017 18:27:40 -0400 Received: from foss.arm.com ([217.140.101.70]:39706 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752712AbdFNW1i (ORCPT ); Wed, 14 Jun 2017 18:27:38 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7ADF119CC; Wed, 14 Jun 2017 15:27:38 -0700 (PDT) Received: from beelzebub.ast.arm.com (beelzebub.austin.arm.com [10.118.12.119]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E6D823F3E1; Wed, 14 Jun 2017 15:27:37 -0700 (PDT) From: Jeremy Linton To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com, rusty@rustcorp.com.au, jeyu@redhat.com, kirill.shutemov@linux.intel.com, christoffer.dall@linaro.org, marc.zyngier@arm.com, jcm@jonmasters.org, clemens@ladisch.de, perex@perex.cz Subject: [PATCH v2 13/13] tracing: Rename and update the enum_map file Date: Wed, 14 Jun 2017 17:27:29 -0500 Message-Id: <20170614222729.16521-14-jeremy.linton@arm.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170614222729.16521-1-jeremy.linton@arm.com> References: <20170614222729.16521-1-jeremy.linton@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Jeremy Linton --- kernel/trace/Kconfig | 22 +++++++++++----------- kernel/trace/trace.c | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) -- 2.9.4 diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 7e06f04..434c840 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 676c808..7297e9d 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); @@ -4717,7 +4717,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) { @@ -4868,15 +4868,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) @@ -7731,7 +7731,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; @@ -7761,7 +7761,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)