From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754497AbcFGNmL (ORCPT ); Tue, 7 Jun 2016 09:42:11 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:34143 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753508AbcFGNmI (ORCPT ); Tue, 7 Jun 2016 09:42:08 -0400 Date: Tue, 7 Jun 2016 22:41:33 +0900 From: Namhyung Kim To: Masami Hiramatsu Cc: Omar Sandoval , Steven Rostedt , Ingo Molnar , linux-kernel@vger.kernel.org, kernel-team@fb.com, Omar Sandoval Subject: Re: [PATCH v2 3/3] tracing: make "string" the default type for [ku]probe event $comm Message-ID: <20160607134133.GB24922@danjae.aot.lge.com> References: <20160607170232.575878d689a656f53d357e22@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160607170232.575878d689a656f53d357e22@kernel.org> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 07, 2016 at 05:02:32PM +0900, Masami Hiramatsu wrote: > On Thu, 2 Jun 2016 18:11:03 -0700 > Omar Sandoval wrote: > > > From: Omar Sandoval > > > > You'd only ever want $comm as a string, but the default is still u64. > > Push the type parsing later so we can decide based on the actual > > fetcharg and make "string" the default for $comm. > > Hmm, at this moment, I'd rather like a small hack in > traceprobe_parse_probe_arg() as like below: > > --- a/kernel/trace/trace_probe.c > +++ b/kernel/trace/trace_probe.c > @@ -522,6 +522,12 @@ int traceprobe_parse_probe_arg(char *arg, ssize_t *size, > arg[t - parg->comm] = '\0'; > t++; > } > + /* > + * The default type of "$comm" should be a string, and it must not > + * be dereferred > + */ > + if (!t && strcmp("$comm", arg)) > + t = "string"; > parg->type = find_fetch_type(t, ftbl); > if (!parg->type) { > pr_info("Unsupported type: %s\n", t); > > This is not general, but easy to review :) +1 Thanks, Namhyung