Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp372286pxp; Fri, 11 Mar 2022 06:05:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfP3JCLxXSAlNtjP0x6NvvjBZmsb+/P3CIvLCtx0aUoOpujLSzBTSDwPSyaJH2WGKw9Way X-Received: by 2002:a17:90a:bf16:b0:1bf:37e2:e71c with SMTP id c22-20020a17090abf1600b001bf37e2e71cmr22267682pjs.96.1647007527574; Fri, 11 Mar 2022 06:05:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647007527; cv=none; d=google.com; s=arc-20160816; b=cThyNB10T2e/8deKKIkMtWaYgQ5fAmqAT6C/xMuqrz+z3OOSuRTsKLBlbNiZQLPASN waPbNaPGHjEWiBLUvpl7gqCk83Ht7Y+kuGFInzrJDSSKo+qtUpoj0lr3IL2+4StBLoxl Gmkz9jLYR77BGVZ/bLtpKY2bWT9l9lcn6Gbc6wWxtxDYiAlMxxYjY+Sss2V9ewfebVgU rhEfOIU7ast358CthJPFgbu+hGAzDNIcJwYZ6IIlfuLskgueP26+vKTVlA8HXizvqtoD 74E5zkotO8ARTRhSloiwEzlrCc2TYSD9XTD8KjX5WU+EBwlJc5W4hy8iQsGyrSrvZ4dM FdDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=golou9TM1kE5JHV028cRGKvqUKkNQ4hhGQRkFR6/4JU=; b=E2MXu6/HIijSoQCMUcZ6wzx2md5md4bsJxx1m/pyjO0hVZeRbjS5LP+SsaIKPM6du9 E3jWMb837DwQZTBnXRzSPgl2LWP3fw/ZNNQJMYB3gQoZ9Iy+s5AoBZu2XrcI3Hq133TW ngJfnpH4tCHjiHr94xqV3L8kSFktwxtQSFB7+IZvQVROaTH3msFVbe1Os7QD/WMiSaIJ 8FQybtdtW1qF/TqUvG6myr5sbXdlep0HFnh1tcv0FM0IfDtohXijzAv2/yY7qC2h5Qxl Fj4T66VMuepfMrs+rMsCkNshNrk90gSJ/Fo+Eq8uZSrrXZhDWe+Fofv+8nJLTCmiLohk BC9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k27-20020a635a5b000000b00368ea83cae4si7417583pgm.682.2022.03.11.06.05.00; Fri, 11 Mar 2022 06:05:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239444AbiCKEdm convert rfc822-to-8bit (ORCPT + 99 others); Thu, 10 Mar 2022 23:33:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241349AbiCKEdl (ORCPT ); Thu, 10 Mar 2022 23:33:41 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1B3E2A71C; Thu, 10 Mar 2022 20:32:38 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 94878B824C7; Fri, 11 Mar 2022 04:32:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8BFDC340EC; Fri, 11 Mar 2022 04:32:35 +0000 (UTC) Date: Thu, 10 Mar 2022 23:32:34 -0500 From: Steven Rostedt To: Ritesh Harjani Cc: linux-ext4@vger.kernel.org, Jan Kara , "Theodore Ts'o" , Harshad Shirwadkar , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2 00/10] ext4: Improve FC trace events Message-ID: <20220310233234.4418186a@gandalf.local.home> In-Reply-To: <20220311031431.3sfbibwuthn4xkym@riteshh-domain> References: <20220310110553.431cc997@gandalf.local.home> <20220310170731.hq6z6flycmgkhnaa@riteshh-domain> <20220310193936.38ae7754@gandalf.local.home> <20220311021931.d4oozgtefbalrcch@riteshh-domain> <20220310213356.3948cfb7@gandalf.local.home> <20220311031431.3sfbibwuthn4xkym@riteshh-domain> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, 11 Mar 2022 08:44:31 +0530 Ritesh Harjani wrote: > > I could update it to do so though. > > Please let me know if you have any patch for me to try. Can you try this? -- Steve From 392b91c598da2a8c5bbaebad08cd0410f4607bf4 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (Google)" Date: Thu, 10 Mar 2022 23:27:38 -0500 Subject: [PATCH] tracing: Have TRACE_DEFINE_ENUM affect trace event types as well The macro TRACE_DEFINE_ENUM is used to convert enums in the kernel to their actual value when they are exported to user space via the trace event format file. Currently only the enums in the "print fmt" (TP_printk in the TRACE_EVENT macro) have the enums converted. But the enums can be used to denote array size: field:unsigned int fc_ineligible_rc[EXT4_FC_REASON_MAX]; offset:12; size:36; signed:0; The EXT4_FC_REASON_MAX has no meaning to userspace but it needs to know that information to know how to parse the array. Have the array indexes also be parsed as well. Link: https://lore.kernel.org/all/cover.1646922487.git.riteshh@linux.ibm.com/ Reported-by: Ritesh Harjani Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 38afd66d80e3..ae9a3b8481f5 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -2633,6 +2633,33 @@ static void update_event_printk(struct trace_event_call *call, } } +static void update_event_fields(struct trace_event_call *call, + struct trace_eval_map *map) +{ + struct ftrace_event_field *field; + struct list_head *head; + char *ptr; + int len = strlen(map->eval_string); + + head = trace_get_fields(call); + list_for_each_entry(field, head, link) { + ptr = strchr(field->type, '['); + if (!ptr) + continue; + ptr++; + + if (!isalpha(*ptr) && *ptr != '_') + continue; + + if (strncmp(map->eval_string, ptr, len) != 0) + continue; + + ptr = eval_replace(ptr, map, len); + /* enum/sizeof string smaller than value */ + WARN_ON_ONCE(!ptr); + } +} + void trace_event_eval_update(struct trace_eval_map **map, int len) { struct trace_event_call *call, *p; @@ -2668,6 +2695,7 @@ void trace_event_eval_update(struct trace_eval_map **map, int len) first = false; } update_event_printk(call, map[i]); + update_event_fields(call, map[i]); } } } -- 2.34.1