From patchwork Fri Mar 8 13:36:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844797 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08CA91390 for ; Fri, 8 Mar 2019 13:37:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E871E2E40A for ; Fri, 8 Mar 2019 13:37:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCFD32E440; Fri, 8 Mar 2019 13:37:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62CC42E40A for ; Fri, 8 Mar 2019 13:37:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726717AbfCHNhU (ORCPT ); Fri, 8 Mar 2019 08:37:20 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38750 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726591AbfCHNhU (ORCPT ); Fri, 8 Mar 2019 08:37:20 -0500 Received: by mail-wr1-f66.google.com with SMTP id g12so21392579wrm.5 for ; Fri, 08 Mar 2019 05:37:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VoK8RZ1bBrmxLQIdPy5NvEXeYk4UUw/Bz0tITaBzfgE=; b=JLXmuMyXoiAr2rnI9qbUd0QFazW8hFc6rrZuYrhlUEe1wfbd7BCrh45UP/qGPPLfiS 7r+2bjfCG11kNoT1kDYhxXzbG/SYCByBURoD4tOaguOVcNl2g0mAkXbWGj7K0s1Nay/D kydY6kG8kirgscZiXLE3YfTLI/pW+c8FPqKxWDO9P0AqJ2C1tljvylS0RSdmgala2BqP 2l0aTlSWp4L67vkt30dTqvC+fzWfbY/HeHQNxV4ay/mH+uEyWkixo3W6hahIzjPJYz6P XULyNK5cN8wdoh6O/ukNfC2ERxbOOW2WbEx0KFt0mjGjYVPqtGA2KUk91lQch3yu9eEx OVYw== X-Gm-Message-State: APjAAAV/3IJeBjAyi0jbFcUUftaWW6cTNs0uZ3ep0fRrpoRci/2teqGm MSHXuOXa0IYeh7zZjw0EzHc= X-Google-Smtp-Source: APXvYqywQuGT7krRvp42oHJv2iObEuffBNEPmFdSMQR493NH9mvgAh58r6MP7Hsecupa4gLNB12W3g== X-Received: by 2002:adf:afe3:: with SMTP id y35mr10839844wrd.318.1552052238292; Fri, 08 Mar 2019 05:37:18 -0800 (PST) Received: from oberon.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id 132sm19625364wmd.27.2019.03.08.05.37.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:17 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 22/46] tools/lib/traceevent: Man pages tep_find_common_field(), tep_find_field() and tep_find_any_field() Date: Fri, 8 Mar 2019 15:36:30 +0200 Message-Id: <20190308133654.21264-23-tstoyanov@vmware.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190308133654.21264-1-tstoyanov@vmware.com> References: <20190308133654.21264-1-tstoyanov@vmware.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Create man pages for tep_find_common_field(), tep_find_field() and tep_find_any_field() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-field_find.txt | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_find.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-field_find.txt b/tools/lib/traceevent/Documentation/libtraceevent-field_find.txt new file mode 100644 index 000000000000..b941988429a0 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-field_find.txt @@ -0,0 +1,98 @@ +libtraceevent(3) +================ + +NAME +---- +tep_find_common_field,tep_find_field,tep_find_any_field - Search for a field in an event. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +struct tep_format_field pass:[*]*tep_find_common_field*(struct tep_event pass:[*]_event_, const char pass:[*]_name_); +struct tep_format_field pass:[*]*tep_find_field*(struct tep_event_ormat pass:[*]_event_, const char pass:[*]_name_); +struct tep_format_field pass:[*]*tep_find_any_field*(struct tep_event pass:[*]_event_, const char pass:[*]_name_); +-- + +DESCRIPTION +----------- +These functions search for a field with given name in an event. + +The _tep_find_common_field()_ function searches for a common field with _name_ +in the _event_. + +The _tep_find_field()_ function searches for an event specific field with +_name_ in the _event_. + +The _tep_find_any_field()_ function searches for any field with _name_ in the +_event_. + +RETURN VALUE +------------ +The _tep_find_common_field(), _tep_find_field()_ and _tep_find_any_field()_ +functions return a pointer to the found field, or NULL in case there is no field +with the requested name. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +struct tep_event *event = tep_find_event_by_name(tep, "timer", "hrtimer_start"); +... + struct tep_format_field *field; + + field = tep_find_common_field(event, "common_pid"); + if (field == NULL) { + /* Cannot find "common_pid" common field in the event */ + } + + field = tep_find_field(event, "softexpires"); + if (field == NULL) { + /* Cannot find "softexpires" event specific field in the event */ + } + + field = tep_find_any_field(event, "mode"); + if (field == NULL) { + /* Cannot find "mode" field in the event */ + } +... +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*-ltraceevent* + Linker switch to add when building a program that uses the library. +-- + +SEE ALSO +-------- +_libtraceevent(3)_, _trace-cmd(1)_ + +AUTHOR +------ +[verse] +-- +*Steven Rostedt* , author of *libtraceevent*. +*Tzvetomir Stoyanov* , author of this man page. +-- +REPORTING BUGS +-------------- +Report bugs to + +LICENSE +------- +libtraceevent is Free Software licensed under the GNU LGPL 2.1 + +RESOURCES +--------- +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git