Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp678166pxv; Thu, 22 Jul 2021 09:33:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyV+yVZGFmPih8NRjpcFZc0ER5sTkRfWrNIKbD0bnxXzPR/+dNDFv4wRs2WD5ekOlLm4Nne X-Received: by 2002:a6b:7514:: with SMTP id l20mr449811ioh.96.1626971633184; Thu, 22 Jul 2021 09:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626971633; cv=none; d=google.com; s=arc-20160816; b=GohjgnCUXhPCseBYo5BFt6Grml5v0fRkO+2VwNtPBEmMjMdv+3rVDV0iQbhOYLOaL3 qlm0In/FXVytr3YkbPUqdGfedFShLOwNcZSLdR9w/koy6QetAHDIZTPrSGEy0MCh8qQi 9hFsbBrWKSlN9QSQ0nSxSYreJHb/1wEmP9GhKKuv2/EeShZaqDtdEMsRddYPkEMesa0F L9nzuqm6rt46rCZOuuLSzUrHeP0Lrvd5VHB+NCXcaI4kujtw1yNn1yJ1ThMzvFIPJ4eL 8c+LPflICB8nP+W8vVgPmU46u8dpE2RXRvQN7vFMhJg5cel33VEmbjcF/oN9Oxgcosvx VMdA== 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=d1uiBVTbPmak7L6WiRQggGDYCXn9BQ3aB8vJduLG5qY=; b=Yo+v/zWLVUnY7P2sgaHWqO9U8HGVctintxkcziG7dc3ljqqqg0UV5IMLw9g/0P33af Gtapyj43+i2EOQxWsx5uzNsw2UvtXFz7nX3nfzbANp7GI9ACES5ni64eQw/obRYJ1gC9 XkU/0uxm6iB0FShN9qK1NphBQi+udrdZUrt0rJGV4qNRXW5ArzqARa51xUEHzYXTUphM mLiV4m1RRyaKc5WEF3UpGzu16U0Ce1/mdlWNLl4l65PJ35T89tdJ0z/SKdUDRnpd5cMG YgI1UPe/X8QFJh8RkPZmVuylVOwH1xizGtYN9pb6Oa26XCF0W7/1C5bWIY07jCED00xI 4MgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si29055734jaq.116.2021.07.22.09.33.41; Thu, 22 Jul 2021 09:33:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229848AbhGVPwJ (ORCPT + 99 others); Thu, 22 Jul 2021 11:52:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:54968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbhGVPwG (ORCPT ); Thu, 22 Jul 2021 11:52:06 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 3DA0D613B6; Thu, 22 Jul 2021 16:32:41 +0000 (UTC) Date: Thu, 22 Jul 2021 12:32:34 -0400 From: Steven Rostedt To: Masami Hiramatsu Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Tom Zanussi , Namhyung Kim Subject: Re: [PATCH v2 2/2] tracing: Allow execnames to be passed as args for synthetic events Message-ID: <20210722123234.636d5363@oasis.local.home> In-Reply-To: <20210723011935.efb25bc4a23ebd567243ed0f@kernel.org> References: <20210722142705.992001628@goodmis.org> <20210722142837.458596338@goodmis.org> <20210723011935.efb25bc4a23ebd567243ed0f@kernel.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 23 Jul 2021 01:19:35 +0900 Masami Hiramatsu wrote: > > +/* Convert a var that points to common_pid.execname to a string */ > > +static void update_var_execname(struct hist_field *hist_field) > > +{ > > + hist_field->flags = HIST_FIELD_FL_STRING | HIST_FIELD_FL_VAR | > > + HIST_FIELD_FL_EXECNAME; > > + hist_field->size = MAX_FILTER_STR_VAL; > > + hist_field->is_signed = 0; > > + > > + kfree_const(hist_field->type); > > + hist_field->type = "char[]"; > > + > > + hist_field->fn = hist_field_execname; > > +} > > Hmm, this is a bit ad-hoc. > > Can't this be done in the create_hist_field()? If you check 'var_name' and > flags & HIST_FIELD_FL_EXECNAME, you can do the same thing I think. Hi Masami, I originally tried that, but then found that it converted the pid over to it as well. So this must be done only for vars, and not only that, it needs to be done in a single place, because I was spending hours debugging it. I found this to be the least intrusive solution. Maybe Tom has a better idea, but I don't have any more time to work on it, and I really want this feature for the next merge window. If you can make it work, and have time to play with it, I'm happy to take an alternative :-) -- Steve