Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4010365pxu; Mon, 12 Oct 2020 07:17:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVn1db0pscipPtCJw/ty7RarKZYvypbB2G0n3weOXCBYDkgaRNCbD8eJCj4Wdur36mKgzk X-Received: by 2002:a17:906:cc0d:: with SMTP id ml13mr27890090ejb.2.1602512224450; Mon, 12 Oct 2020 07:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602512224; cv=none; d=google.com; s=arc-20160816; b=wjTMthLI/SiiPPXxfftH2p3g4HG+NWl25GHMZEOuIxeQ/ZApz3OndC2NFhA1vqBhzK ALjgCVD9I1QYx4SZFQtz6G6HzKJa08od9iJibc64bZYOBAjeTaJKPO8xb+eYa5NNLPtq JZk71Jhcg0YapavkItEy5hzX2ln0BbSYlht0sx8SKHiHhvVY7gnlUfPRIbVkM79Pw/4q OTl4ujIJIDWm2NTVK85rrtOXxFbi4Rkctdbkn7BywYsjN0r87PALgRq2fexWc4DiwQe6 0+T+/INlEBnpYwIlC77K2CwUBF8o12ypVrEAOBPvpnky1uF8oTHkVrlaVHiFPe1ItEKD HLJw== 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=5sX/r3moMdbm7Pa3sdwqcUV49eKVCQHnmDYglw0TqXU=; b=NF3vcaYU0GngqIy3anghwLPzk2bXggU5yTEEOnNyX/OZ9fd7H0oG5W6oBhbo2C0Ezi t6CJ38gG/j92iJO+dDN/XxH+WcgvUO0lBdlp7a33vU1zGotjsIB/lr16b/KE9GipkZtK MehqzJ+CrLzrLkoiLTKwxl7DRASw8Ew4PcKx8tRFjCxnGTPTwH7SBDtKAJWFYK8J6rxX YlZcKNuM405kDZRwXbHFESpH3hyyUd0dQ59rKEEmDXq6yJ+XtAVgM87BgQT1CAXbgYp/ ITYajBcdKI4xdhZOIAGf4xTYW9MHmzzwhvNqQSTnI4EfqA4oqHMREpKCEzIFNWubervY zPyw== 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 g19si7254961ejd.105.2020.10.12.07.16.40; Mon, 12 Oct 2020 07:17:04 -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 S1730935AbgJLOPb (ORCPT + 99 others); Mon, 12 Oct 2020 10:15:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:48782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726724AbgJLOPb (ORCPT ); Mon, 12 Oct 2020 10:15:31 -0400 Received: from gandalf.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 026302076E; Mon, 12 Oct 2020 14:15:29 +0000 (UTC) Date: Mon, 12 Oct 2020 10:15:27 -0400 From: Steven Rostedt To: Axel Rasmussen , Tom Zanussi Cc: Ingo Molnar , Andrew Morton , Michel Lespinasse , Vlastimil Babka , Daniel Jordan , Laurent Dufour , Jann Horn , Chinwen Chang , Yafang Shao , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 1/2] tracing: support "bool" type in synthetic trace events Message-ID: <20201012101527.6df53dda@gandalf.local.home> In-Reply-To: <20201009220524.485102-2-axelrasmussen@google.com> References: <20201009220524.485102-1-axelrasmussen@google.com> <20201009220524.485102-2-axelrasmussen@google.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; 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 Tom, Can you ack this patch for me? -- Steve On Fri, 9 Oct 2020 15:05:23 -0700 Axel Rasmussen wrote: > It's common [1] to define tracepoint fields as "bool" when they contain > a true / false value. Currently, defining a synthetic event with a > "bool" field yields EINVAL. It's possible to work around this by using > e.g. u8 (assuming sizeof(bool) is 1, and bool is unsigned; if either of > these properties don't match, you get EINVAL [2]). > > Supporting "bool" explicitly makes hooking this up easier and more > portable for userspace. > > [1]: grep -r "bool" include/trace/events/ > [2]: check_synth_field() in kernel/trace/trace_events_hist.c > > Acked-by: Michel Lespinasse > Signed-off-by: Axel Rasmussen > --- > kernel/trace/trace_events_synth.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c > index 8e1974fbad0e..8f94c84349a6 100644 > --- a/kernel/trace/trace_events_synth.c > +++ b/kernel/trace/trace_events_synth.c > @@ -234,6 +234,8 @@ static int synth_field_size(char *type) > size = sizeof(long); > else if (strcmp(type, "unsigned long") == 0) > size = sizeof(unsigned long); > + else if (strcmp(type, "bool") == 0) > + size = sizeof(bool); > else if (strcmp(type, "pid_t") == 0) > size = sizeof(pid_t); > else if (strcmp(type, "gfp_t") == 0) > @@ -276,6 +278,8 @@ static const char *synth_field_fmt(char *type) > fmt = "%ld"; > else if (strcmp(type, "unsigned long") == 0) > fmt = "%lu"; > + else if (strcmp(type, "bool") == 0) > + fmt = "%d"; > else if (strcmp(type, "pid_t") == 0) > fmt = "%d"; > else if (strcmp(type, "gfp_t") == 0) > -- > 2.28.0.1011.ga647a8990f-goog