Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4603231img; Tue, 26 Mar 2019 12:44:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZqwn+xwduZCoGqlsftXN4MT2MWLqKCzJX1lOLzPjP8jDy/alVgNGvQlb2U7OnWc06qo1P X-Received: by 2002:a17:902:9884:: with SMTP id s4mr33033126plp.110.1553629450411; Tue, 26 Mar 2019 12:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553629450; cv=none; d=google.com; s=arc-20160816; b=mM2A3VlUwjKLfW+QRwGsSSx7Hclg1gSuk5+3kCjWGhrIPEkgBt4BHlfZSaUKpGXTyv HiGhnD24P5cZ89f2jUiJoitxG1ESnrmF/8YkptqtQyGkkliqIpQWXKeHKUAswucyv2U1 9d9GKqQwILQSf2kAZQ73OFJkLGhmNUuKBfif3RAOUO5Y5yuKBPM0G8Njjg5eIxPJw6et UtJuIwFNjIwL2BOj6dtSDIduB/Po8AItBaYcvQxtANPvcr5+ot2lrx9wl81SOvOSN+QN WO1BWKhRJ1VH3GoqzTuN82zbCW5qB0F9iCN9hbD9Ct3Ytx8JtD1o7Rr0XIjYkywm55+N WnKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Xg2w6PLIjG+bth2qvpxslFTsD0BIYSmYFIrV644CQ0M=; b=Tw1z/e5XtjBG7SVpVnpdnzndC/RVMmVMZ2YtG6G6UgnnFtK4kNJiuNVKWUrbr0HFdW Uh5RiFYg7nc6jFajhl4AcL4iRjb15Y9LloZkgmUnRywBUA+EoqshDVRL9Nsvff1dNn7X ebmP69FGiguz+h6Nyl0DZq6ILTDE6FlPzVAS2Uxyc9KC9Lw/sxoG3veeqRmogH3XIzlS uRGzl6gET14QC1RpUng16N+J7YNBDIhg4CYwlrMznh8EoRNjifp+Mmo4SW8hqYkv4G7i EGAo+SopqQB+f/glYnuNq5iIs6zXY11CSQ98PU8vBx/eV6wPAv25+M8mChLywRxksTnG Q/vA== 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 f1si16465116pfn.10.2019.03.26.12.43.54; Tue, 26 Mar 2019 12:44:10 -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 S1732119AbfCZTnW (ORCPT + 99 others); Tue, 26 Mar 2019 15:43:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:57410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730449AbfCZTnW (ORCPT ); Tue, 26 Mar 2019 15:43:22 -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 F2FD020823; Tue, 26 Mar 2019 19:43:20 +0000 (UTC) Date: Tue, 26 Mar 2019 15:43:18 -0400 From: Steven Rostedt To: Tzvetomir Stoyanov Cc: linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/8] tools/perf,tools/lib/traceevent: Make traceevent APIs more consistent Message-ID: <20190326154318.70716fbb@gandalf.local.home> In-Reply-To: <20190326154328.28718-2-tstoyanov@vmware.com> References: <20190326154328.28718-1-tstoyanov@vmware.com> <20190326154328.28718-2-tstoyanov@vmware.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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Mar 2019 17:43:21 +0200 Tzvetomir Stoyanov wrote: > Rename some traceevent APIs for consistency: > > tep_pid_is_registered() to tep_is_pid_registered() > tep_file_bigendian() to tep_is_file_bigendian() > to make the names and return values consistent with other tep_is_... APIs > > tep_data_lat_fmt() to tep_data_latency_format() > to make the name more descriptive > > tep_host_bigendian() to tep_is_bigendian() > tep_set_host_bigendian() to tep_set_local_bigendian() > tep_is_host_bigendian() to tep_is_local_bigendian() > "host" can be confused with VMs, and "local" is about the local > machine. All tep_is_..._bigendian(struct tep_handle *tep) APIs return > the saved data in the tep handle, while tep_is_bigendian() returns > the running machine's endianness. > > All tep_is_... functions are modified to return bool value, instead of int. Much nicer ;-) > > Signed-off-by: Tzvetomir Stoyanov > --- > tools/lib/traceevent/event-parse-api.c | 44 +++++++++++++------------- > tools/lib/traceevent/event-parse.c | 26 +++++++-------- > tools/lib/traceevent/event-parse.h | 16 +++++----- > tools/lib/traceevent/plugin_kvm.c | 4 +-- > tools/perf/util/trace-event-read.c | 2 +- > tools/perf/util/trace-event.c | 4 +-- > 6 files changed, 48 insertions(+), 48 deletions(-) > > diff --git a/tools/lib/traceevent/event-parse-api.c b/tools/lib/traceevent/event-parse-api.c > index 2ac8b44854ce..46670bb87051 100644 > --- a/tools/lib/traceevent/event-parse-api.c > +++ b/tools/lib/traceevent/event-parse-api.c > @@ -88,7 +88,7 @@ void tep_clear_flag(struct tep_handle *tep, enum tep_flag flag) > bool tep_test_flag(struct tep_handle *tep, enum tep_flag flag) > { > if (tep) > - return (tep->flags & flag); > + return !!(tep->flags & flag); This isn't needed. The fact hat this returns "bool", the compiler will handle thins the same regardless. > return false; > } > > @@ -306,14 +306,14 @@ void tep_set_host_bigendian(struct tep_handle *pevent, enum tep_endian endian) > * tep_is_latency_format - get if the latency output format is configured > * @pevent: a handle to the tep_handle > * > - * This gets if the latency output format is configured > - * If @pevent is NULL, 0 is returned. > + * This returns true if the latency output format is configured > + * If @pevent is NULL, false is returned. > */ > -int tep_is_latency_format(struct tep_handle *pevent) > +bool tep_is_latency_format(struct tep_handle *pevent) > { > if (pevent) > - return pevent->latency_format; > - return 0; > + return !!(pevent->latency_format); Same here. > + return false; > } > > /** The rest looks good. -- Steve