From patchwork Fri Mar 8 13:36:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844761 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 4A2061390 for ; Fri, 8 Mar 2019 13:37:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F1E02E40A for ; Fri, 8 Mar 2019 13:37:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2342B2E440; Fri, 8 Mar 2019 13:37:04 +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 37D682E40A for ; Fri, 8 Mar 2019 13:37:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbfCHNhC (ORCPT ); Fri, 8 Mar 2019 08:37:02 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:53115 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbfCHNhB (ORCPT ); Fri, 8 Mar 2019 08:37:01 -0500 Received: by mail-wm1-f65.google.com with SMTP id f65so12568238wma.2 for ; Fri, 08 Mar 2019 05:36:59 -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=91kCSB6IBeIBIg7AQs/2YkmAXqkqbomF9UmxQK+Ke8U=; b=GfQVlMs7DTA8GFKJl99zzfCm3uQUzkmmx9ZpY36HpYxzGKAZ1tpHGAgIy+JyRL0UBR nnm6GQ4n0C1ezsGYIYEMLPN4GRgVfWQcGl7vqgCQL9DdYfM7zCcZKzJwsHjlF57upXTk /Sy4Q2Z2aGUND3ketQcm4AB9Wse9QjI8Mg5PRwR4O47MBcV0whE0RrE3nTZ41gowh5JB xQiAFxVTJzYHbdUGF2zJM2ghFNDUDlFHXllpDDPeVpOuZO0pC5FGHUNGRTgtizJAMJc4 H/RgYChqiYDUe8/58SzqgJDiWn32zW4G6jULl6COk2aUmNtBsVXjngdjJeROihZ+HRyl SazQ== X-Gm-Message-State: APjAAAWtDP13EW0fa+2HHMb6d4HolOXDpySbVbq00MQXgF3hNBaEQqZY BfMbSxtbnJxCOvaudR3OkA0= X-Google-Smtp-Source: APXvYqyx2pUCMqjVJPc0+yMSJSfKgsOnT3BeXsrqAw6gT1FFZRxF8PedAFgS3oQmxk2C5diYcY/neA== X-Received: by 2002:a05:600c:2115:: with SMTP id u21mr9716256wml.70.1552052218281; Fri, 08 Mar 2019 05:36:58 -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.36.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:36:57 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 01/46] tools/lib/traceevent: Implement libtraceevent man pages Date: Fri, 8 Mar 2019 15:36:09 +0200 Message-Id: <20190308133654.21264-2-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 This patch adds initial support for libtraceevent man pages - Documentation directory, templates, configurations, Makefiles. The first man page is also part of the patch - summary of the library and all its APIs. Building of the documentation is integrated into the libtraceevent build process, new targets are added to its Makefile: make doc make doc-clean make doc-install make doc-uninstall Signed-off-by: Tzvetomir Stoyanov Reviewed-by: Matt Helsley --- tools/lib/traceevent/Documentation/Makefile | 205 ++++++++++++++++++ .../traceevent/Documentation/asciidoc.conf | 91 ++++++++ .../Documentation/libtraceevent.txt | 198 +++++++++++++++++ .../traceevent/Documentation/manpage-1.72.xsl | 14 ++ .../traceevent/Documentation/manpage-base.xsl | 35 +++ .../Documentation/manpage-bold-literal.xsl | 17 ++ .../Documentation/manpage-normal.xsl | 13 ++ .../Documentation/manpage-suppress-sp.xsl | 21 ++ tools/lib/traceevent/Makefile | 13 ++ 9 files changed, 607 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/Makefile create mode 100644 tools/lib/traceevent/Documentation/asciidoc.conf create mode 100644 tools/lib/traceevent/Documentation/libtraceevent.txt create mode 100644 tools/lib/traceevent/Documentation/manpage-1.72.xsl create mode 100644 tools/lib/traceevent/Documentation/manpage-base.xsl create mode 100644 tools/lib/traceevent/Documentation/manpage-bold-literal.xsl create mode 100644 tools/lib/traceevent/Documentation/manpage-normal.xsl create mode 100644 tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl diff --git a/tools/lib/traceevent/Documentation/Makefile b/tools/lib/traceevent/Documentation/Makefile new file mode 100644 index 000000000000..e17c0723b4e1 --- /dev/null +++ b/tools/lib/traceevent/Documentation/Makefile @@ -0,0 +1,205 @@ +include ../../../scripts/Makefile.include +include ../../../scripts/utilities.mak + +MAN3_TXT= \ + $(wildcard libtraceevent-*.txt) \ + libtraceevent.txt + +MAN_TXT = $(MAN3_TXT) +_MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT)) +_MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT)) +_DOC_MAN3=$(patsubst %.txt,%.3,$(MAN3_TXT)) + +MAN_XML=$(addprefix $(OUTPUT),$(_MAN_XML)) +MAN_HTML=$(addprefix $(OUTPUT),$(_MAN_HTML)) +DOC_MAN3=$(addprefix $(OUTPUT),$(_DOC_MAN3)) + +# Make the path relative to DESTDIR, not prefix +ifndef DESTDIR +prefix?=$(HOME) +endif +bindir?=$(prefix)/bin +htmldir?=$(prefix)/share/doc/libtraceevent-doc +pdfdir?=$(prefix)/share/doc/libtraceevent-doc +mandir?=$(prefix)/share/man +man3dir=$(mandir)/man3 + +ASCIIDOC=asciidoc +ASCIIDOC_EXTRA = --unsafe -f asciidoc.conf +ASCIIDOC_HTML = xhtml11 +MANPAGE_XSL = manpage-normal.xsl +XMLTO_EXTRA = +INSTALL?=install +RM ?= rm -f + +ifdef USE_ASCIIDOCTOR +ASCIIDOC = asciidoctor +ASCIIDOC_EXTRA = -a compat-mode +ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions +ASCIIDOC_EXTRA += -a mansource="libtraceevent" -a manmanual="libtraceevent Manual" +ASCIIDOC_HTML = xhtml5 +endif + +XMLTO=xmlto + +_tmp_tool_path := $(call get-executable,$(ASCIIDOC)) +ifeq ($(_tmp_tool_path),) + missing_tools = $(ASCIIDOC) +endif + +ifndef USE_ASCIIDOCTOR +_tmp_tool_path := $(call get-executable,$(XMLTO)) +ifeq ($(_tmp_tool_path),) + missing_tools += $(XMLTO) +endif +endif + +# +# For asciidoc ... +# -7.1.2, no extra settings are needed. +# 8.0-, set ASCIIDOC8. +# + +# +# For docbook-xsl ... +# -1.68.1, set ASCIIDOC_NO_ROFF? (based on changelog from 1.73.0) +# 1.69.0, no extra settings are needed? +# 1.69.1-1.71.0, set DOCBOOK_SUPPRESS_SP? +# 1.71.1, no extra settings are needed? +# 1.72.0, set DOCBOOK_XSL_172. +# 1.73.0-, set ASCIIDOC_NO_ROFF +# + +# +# If you had been using DOCBOOK_XSL_172 in an attempt to get rid +# of 'the ".ft C" problem' in your generated manpages, and you +# instead ended up with weird characters around callouts, try +# using ASCIIDOC_NO_ROFF instead (it works fine with ASCIIDOC8). +# + +ifdef ASCIIDOC8 +ASCIIDOC_EXTRA += -a asciidoc7compatible +endif +ifdef DOCBOOK_XSL_172 +ASCIIDOC_EXTRA += -a libtraceevent-asciidoc-no-roff +MANPAGE_XSL = manpage-1.72.xsl +else + ifdef ASCIIDOC_NO_ROFF + # docbook-xsl after 1.72 needs the regular XSL, but will not + # pass-thru raw roff codes from asciidoc.conf, so turn them off. + ASCIIDOC_EXTRA += -a libtraceevent-asciidoc-no-roff + endif +endif +ifdef MAN_BOLD_LITERAL +XMLTO_EXTRA += -m manpage-bold-literal.xsl +endif +ifdef DOCBOOK_SUPPRESS_SP +XMLTO_EXTRA += -m manpage-suppress-sp.xsl +endif + +SHELL_PATH ?= $(SHELL) +# Shell quote; +SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) + +DESTDIR ?= +DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))' + +export DESTDIR DESTDIR_SQ + +# +# Please note that there is a minor bug in asciidoc. +# The version after 6.0.3 _will_ include the patch found here: +# http://marc.theaimsgroup.com/?l=libtraceevent&m=111558757202243&w=2 +# +# Until that version is released you may have to apply the patch +# yourself - yes, all 6 characters of it! +# +QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir +QUIET_SUBDIR1 = + +ifneq ($(findstring $(MAKEFLAGS),w),w) +PRINT_DIR = --no-print-directory +else # "make -w" +NO_SUBDIR = : +endif + +ifneq ($(findstring $(MAKEFLAGS),s),s) +ifneq ($(V),1) + QUIET_ASCIIDOC = @echo ' ASCIIDOC '$@; + QUIET_XMLTO = @echo ' XMLTO '$@; + QUIET_SUBDIR0 = +@subdir= + QUIET_SUBDIR1 = ;$(NO_SUBDIR) \ + echo ' SUBDIR ' $$subdir; \ + $(MAKE) $(PRINT_DIR) -C $$subdir + export V +endif +endif + +all: html man + +man: man3 +man3: $(DOC_MAN3) + +html: $(MAN_HTML) + +$(MAN_HTML) $(DOC_MAN3): asciidoc.conf + +install: install-man + +check-man-tools: +ifdef missing_tools + $(error "You need to install $(missing_tools) for man pages") +endif + +do-install-man: man + $(call QUIET_INSTALL, Documentation-man) \ + $(INSTALL) -d -m 755 $(DESTDIR)$(man3dir); \ + $(INSTALL) -m 644 $(DOC_MAN3) $(DESTDIR)$(man3dir); + +install-man: check-man-tools man do-install-man + +uninstall: uninstall-man + +uninstall-man: + $(call QUIET_UNINST, Documentation-man) \ + $(Q)$(RM) $(addprefix $(DESTDIR)$(man3dir)/,$(DOC_MAN3)) + + +ifdef missing_tools + DO_INSTALL_MAN = $(warning Please install $(missing_tools) to have the man pages installed) +else + DO_INSTALL_MAN = do-install-man +endif + +CLEAN_FILES = \ + $(MAN_XML) $(addsuffix +,$(MAN_XML)) \ + $(MAN_HTML) $(addsuffix +,$(MAN_HTML)) \ + $(DOC_MAN3) + +clean: + $(call QUIET_CLEAN, Documentation) $(RM) $(CLEAN_FILES) + +ifdef USE_ASCIIDOCTOR +$(OUTPUT)%.3 : $(OUTPUT)%.txt + $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ + $(ASCIIDOC) -b manpage -d manpage \ + $(ASCIIDOC_EXTRA) -alibtraceevent_version=$(EVENT_PARSE_VERSION) -o $@+ $< && \ + mv $@+ $@ +endif + +$(OUTPUT)%.3 : $(OUTPUT)%.xml + $(QUIET_XMLTO)$(RM) $@ && \ + $(XMLTO) -o $(OUTPUT). -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< + +$(OUTPUT)%.xml : %.txt + $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ + $(ASCIIDOC) -b docbook -d manpage \ + $(ASCIIDOC_EXTRA) -alibtraceevent_version=$(EVENT_PARSE_VERSION) -o $@+ $< && \ + mv $@+ $@ + +$(MAN_HTML): $(OUTPUT)%.html : %.txt + $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ + $(ASCIIDOC) -b $(ASCIIDOC_HTML) -d manpage \ + $(ASCIIDOC_EXTRA) -aperf_version=$(EVENT_PARSE_VERSION) -o $@+ $< && \ + mv $@+ $@ + diff --git a/tools/lib/traceevent/Documentation/asciidoc.conf b/tools/lib/traceevent/Documentation/asciidoc.conf new file mode 100644 index 000000000000..1b03c63fb73a --- /dev/null +++ b/tools/lib/traceevent/Documentation/asciidoc.conf @@ -0,0 +1,91 @@ +## linktep: macro +# +# Usage: linktep:command[manpage-section] +# +# Note, {0} is the manpage section, while {target} is the command. +# +# Show TEP link as: (
); if section is defined, else just show +# the command. + +[macros] +(?su)[\\]?(?Plinktep):(?P\S*?)\[(?P.*?)\]= + +[attributes] +asterisk=* +plus=+ +caret=^ +startsb=[ +endsb=] +tilde=~ + +ifdef::backend-docbook[] +[linktep-inlinemacro] +{0%{target}} +{0#} +{0#{target}{0}} +{0#} +endif::backend-docbook[] + +ifdef::backend-docbook[] +ifndef::tep-asciidoc-no-roff[] +# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this. +# v1.72 breaks with this because it replaces dots not in roff requests. +[listingblock] +{title} + +ifdef::doctype-manpage[] + .ft C +endif::doctype-manpage[] +| +ifdef::doctype-manpage[] + .ft +endif::doctype-manpage[] + +{title#} +endif::tep-asciidoc-no-roff[] + +ifdef::tep-asciidoc-no-roff[] +ifdef::doctype-manpage[] +# The following two small workarounds insert a simple paragraph after screen +[listingblock] +{title} + +| + +{title#} + +[verseblock] +{title} +{title%} +{title#} +| + +{title#} +{title%} +endif::doctype-manpage[] +endif::tep-asciidoc-no-roff[] +endif::backend-docbook[] + +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[header] +template::[header-declarations] + + +{mantitle} +{manvolnum} +trace-cmd +{libtraceevent_version} +trace-cmd Manual + + + {manname} + {manpurpose} + +endif::backend-docbook[] +endif::doctype-manpage[] + +ifdef::backend-xhtml11[] +[linktep-inlinemacro] +{target}{0?({0})} +endif::backend-xhtml11[] diff --git a/tools/lib/traceevent/Documentation/libtraceevent.txt b/tools/lib/traceevent/Documentation/libtraceevent.txt new file mode 100644 index 000000000000..14125261661c --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent.txt @@ -0,0 +1,198 @@ +libtraceevent(3) +================ + +NAME +---- +libtraceevent - Linux kernel trace event library + +SYNOPSIS +-------- +[verse] +-- +*#include * + +Management of tep handler data structure and access of its members: + struct tep_handle pass:[*]*tep_alloc*(void); + void *tep_free*(struct tep_handle pass:[*]_tep_); + void *tep_ref*(struct tep_handle pass:[*]_tep_); + void *tep_unref*(struct tep_handle pass:[*]_tep_); + int *tep_ref_get*(struct tep_handle pass:[*]_tep_); + void *tep_set_flag*(struct tep_handle pass:[*]_tep_, int _flag_); + int *tep_get_cpus*(struct tep_handle pass:[*]_tep_); + void *tep_set_cpus*(struct tep_handle pass:[*]_tep_, int _cpus_); + int *tep_get_long_size*(strucqt tep_handle pass:[*]_tep_); + void *tep_set_long_size*(struct tep_handle pass:[*]_tep_, int _long_size_); + int *tep_get_page_size*(struct tep_handle pass:[*]_tep_); + void *tep_set_page_size*(struct tep_handle pass:[*]_tep_, int _page_size_); + int *tep_is_latency_format*(struct tep_handle pass:[*]_tep_); + void *tep_set_latency_format*(struct tep_handle pass:[*]_tep_, int _lat_); + int *tep_get_header_page_size*(struct tep_handle pass:[*]_tep_); + int *tep_strerror*(struct tep_handle pass:[*]_tep_, enum tep_errno _errnum_, char pass:[*]_buf_, size_t _buflen_); + +Register / unregister APIs: + int *tep_register_trace_clock*(struct tep_handle pass:[*]_tep_, const char pass:[*]_trace_clock_); + int *tep_register_function*(struct tep_handle pass:[*]_tep_, char pass:[*]_name_, unsigned long long _addr_, char pass:[*]_mod_); + int *tep_register_event_handler*(struct tep_handle pass:[*]_tep_, int _id_, const char pass:[*]_sys_name_, const char pass:[*]_event_name_, tep_event_handler_func _func_, void pass:[*]_context_); + int *tep_unregister_event_handler*(struct tep_handle pass:[*]tep, int id, const char pass:[*]sys_name, const char pass:[*]event_name, tep_event_handler_func func, void pass:[*]_context_); + int *tep_register_print_string*(struct tep_handle pass:[*]_tep_, const char pass:[*]_fmt_, unsigned long long _addr_); + int *tep_register_print_function*(struct tep_handle pass:[*]_tep_, tep_func_handler _func_, enum tep_func_arg_type _ret_type_, char pass:[*]_name_, _..._); + int *tep_unregister_print_function*(struct tep_handle pass:[*]_tep_, tep_func_handler _func_, char pass:[*]_name_); + +Plugins management: + struct tep_plugin_list pass:[*]*tep_load_plugins*(struct tep_handle pass:[*]_tep_); + void *tep_unload_plugins*(struct tep_plugin_list pass:[*]_plugin_list_, struct tep_handle pass:[*]_tep_); + char pass:[*]pass:[*]*tep_plugin_list_options*(void); + void *tep_plugin_free_options_list*(char pass:[*]pass:[*]_list_); + int *tep_plugin_add_options*(const char pass:[*]_name_, struct tep_plugin_option pass:[*]_options_); + void *tep_plugin_remove_options*(struct tep_plugin_option pass:[*]_options_); + void *tep_print_plugins*(struct trace_seq pass:[*]_s_, const char pass:[*]_prefix_, const char pass:[*]_suffix_, const struct tep_plugin_list pass:[*]_list_); + +Event related APIs: + struct tep_event pass:[*]*tep_get_first_event*(struct tep_handle pass:[*]_tep_); + int *tep_get_events_count*(struct tep_handle pass:[*]_tep_); + struct tep_event pass:[*]pass:[*]*tep_list_events*(struct tep_handle pass:[*]_tep_, enum tep_event_sort_type _sort_type_); + +Event printing: + void *tep_print_event*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_record pass:[*]_record_, bool _use_trace_clock_); + void *tep_print_event_data*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_); + void *tep_event_info*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_); + void *tep_print_event_task*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_); + void *tep_print_event_time*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]record, bool _use_trace_clock_); + +Event finding: + struct tep_event pass:[*]*tep_find_event*(struct tep_handle pass:[*]_tep_, int _id_); + struct tep_event pass:[*]*tep_find_event_by_name*(struct tep_handle pass:[*]_tep_, const char pass:[*]_sys_, const char pass:[*]_name_); + struct tep_event pass:[*]*tep_find_event_by_record*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_record_); + +Parsing of event files: + int *tep_parse_header_page*(struct tep_handle pass:[*]_tep_, char pass:[*]_buf_, unsigned long _size_, int _long_size_); + enum tep_errno *tep_parse_event*(struct tep_handle pass:[*]_tep_, const char pass:[*]_buf_, unsigned long _size_, const char pass:[*]_sys_); + enum tep_errno *tep_parse_format*(struct tep_handle pass:[*]_tep_, struct tep_event pass:[*]pass:[*]_eventp_, const char pass:[*]_buf_, unsigned long _size_, const char pass:[*]_sys_); + +APIs related to fields from event's format files: + struct tep_format_field pass:[*]pass:[*]*tep_event_common_fields*(struct tep_event pass:[*]_event_); + struct tep_format_field pass:[*]pass:[*]*tep_event_fields*(struct tep_event pass:[*]_event_); + void pass:[*]*tep_get_field_raw*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int pass:[*]_len_, int _err_); + int *tep_get_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_); + int *tep_get_common_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_); + int *tep_get_any_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_); + int *tep_read_number_field*(struct tep_format_field pass:[*]_field_, const void pass:[*]_data_, unsigned long long pass:[*]_value_); + +Event fileds printing: + void *tep_print_field*(struct trace_seq pass:[*]_s_, void pass:[*]_data_, struct tep_format_field pass:[*]_field_); + void *tep_print_fields*(struct trace_seq pass:[*]_s_, void pass:[*]_data_, int _size_, struct tep_event pass:[*]_event_); + int *tep_print_num_field*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int _err_); + int *tep_print_func_field*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int _err_); + +Event fileds finding: + 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_); + +Functions resolver: + int *tep_set_function_resolver*(struct tep_handle pass:[*]_tep_, tep_func_resolver_t pass:[*]_func_, void pass:[*]_priv_); + void *tep_reset_function_resolver*(struct tep_handle pass:[*]_tep_); + const char pass:[*]*tep_find_function*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_); + unsigned long long *tep_find_function_address*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_); + +Filter management: + struct tep_event_filter pass:[*]*tep_filter_alloc*(struct tep_handle pass:[*]_tep_); + enum tep_errno *tep_filter_add_filter_str*(struct tep_event_filter pass:[*]_filter_, const char pass:[*]_filter_str_); + enum tep_errno *tep_filter_match*(struct tep_event_filter pass:[*]_filter_, struct tep_record pass:[*]_record_); + int *tep_filter_strerror*(struct tep_event_filter pass:[*]_filter_, enum tep_errno _err_, char pass:[*]buf, size_t _buflen_); + int *tep_event_filtered*(struct tep_event_filter pass:[*]_filter_, int _event_id_); + void *tep_filter_reset*(struct tep_event_filter pass:[*]_filter_); + int *tep_filter_clear_trivial*(struct tep_event_filter pass:[*]_filter_, enum tep_filter_trivial_type _type_); + void *tep_filter_free*(struct tep_event_filter pass:[*]_filter_); + char pass:[*]*tep_filter_make_string*(struct tep_event_filter pass:[*]_filter_, int _event_id_); + int *tep_filter_remove_event*(struct tep_event_filter pass:[*]_filter_, int _event_id_); + int *tep_filter_event_has_trivial*(struct tep_event_filter pass:[*]_filter_, int _event_id_, enum tep_filter_trivial_type _type_); + int *tep_filter_copy*(struct tep_event_filter pass:[*]_dest_, struct tep_event_filter pass:[*]_source_); + int *tep_update_trivial*(struct tep_event_filter pass:[*]_dest_, struct tep_event_filter pass:[*]_source_, enum tep_filter_trivial_type _type_); + int *tep_filter_compare*(struct tep_event_filter pass:[*]_filter1_, struct tep_event_filter pass:[*]_filter2_); + +Parsing various data from the records: + void *tep_data_lat_fmt*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_record pass:[*]_record_); + int *tep_data_type*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_); + int *tep_data_pid*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_); + int *tep_data_preempt_count*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_); + int *tep_data_flags*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_); + +Command and task related APIs: + const char pass:[*]*tep_data_comm_from_pid*(struct tep_handle pass:[*]_tep_, int _pid_); + struct cmdline pass:[*]*tep_data_pid_from_comm*(struct tep_handle pass:[*]_tep_, const char pass:[*]_comm_, struct cmdline pass:[*]_next_); + int *tep_register_comm*(struct tep_handle pass:[*]_tep_, const char pass:[*]_comm_, int _pid_); + int *tep_pid_is_registered*(struct tep_handle pass:[*]_tep_, int _pid_); + int *tep_cmdline_pid*(struct tep_handle pass:[*]_tep_, struct cmdline pass:[*]_cmdline_); + +Endian related APIs: + int *tep_host_bigendian*(void); + unsigned long long *tep_read_number*(struct tep_handle pass:[*]_tep_, const void pass:[*]_ptr_, int _size_); + int *tep_file_bigendian*(struct tep_handle pass:[*]_tep_); + void *tep_set_file_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_); + int *tep_is_host_bigendian*(struct tep_handle pass:[*]_tep_); + void *tep_set_host_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_); + +Trace sequences: +*#include * + void *trace_seq_init*(struct trace_seq pass:[*]_s_); + void *trace_seq_reset*(struct trace_seq pass:[*]_s_); + void *trace_seq_destroy*(struct trace_seq pass:[*]_s_); + int *trace_seq_printf*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, ...); + int *trace_seq_vprintf*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, va_list _args_); + int *trace_seq_puts*(struct trace_seq pass:[*]_s_, const char pass:[*]_str_); + int *trace_seq_putc*(struct trace_seq pass:[*]_s_, unsigned char _c_); + void *trace_seq_terminate*(struct trace_seq pass:[*]_s_); + int *trace_seq_do_fprintf*(struct trace_seq pass:[*]_s_, FILE pass:[*]_fp_); + int *trace_seq_do_printf*(struct trace_seq pass:[*]_s_); +-- + +DESCRIPTION +----------- +The libtraceevent(3) library provides APIs to access kernel tracepoint events, +located in the debugfs file system under the tracing/events directory. + +ENVIRONMENT +----------- +[verse] +-- +TRACEEVENT_PLUGIN_DIR + Additional plugin directory. All shared object files, located in this directory will be loaded as traceevent plugins. +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related APIs. + Trace sequences are used to allow a function to call several other functions + to create a string of data to use. +*-ltraceevent* + Linker switch to add when building a program that uses the library. +-- + +SEE ALSO +-------- +_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 diff --git a/tools/lib/traceevent/Documentation/manpage-1.72.xsl b/tools/lib/traceevent/Documentation/manpage-1.72.xsl new file mode 100644 index 000000000000..b4d315cb8c47 --- /dev/null +++ b/tools/lib/traceevent/Documentation/manpage-1.72.xsl @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/tools/lib/traceevent/Documentation/manpage-base.xsl b/tools/lib/traceevent/Documentation/manpage-base.xsl new file mode 100644 index 000000000000..a264fa616093 --- /dev/null +++ b/tools/lib/traceevent/Documentation/manpage-base.xsl @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + sp + + + + + + + + br + + + diff --git a/tools/lib/traceevent/Documentation/manpage-bold-literal.xsl b/tools/lib/traceevent/Documentation/manpage-bold-literal.xsl new file mode 100644 index 000000000000..608eb5df6281 --- /dev/null +++ b/tools/lib/traceevent/Documentation/manpage-bold-literal.xsl @@ -0,0 +1,17 @@ + + + + + + + fB + + + fR + + + diff --git a/tools/lib/traceevent/Documentation/manpage-normal.xsl b/tools/lib/traceevent/Documentation/manpage-normal.xsl new file mode 100644 index 000000000000..a48f5b11f3dc --- /dev/null +++ b/tools/lib/traceevent/Documentation/manpage-normal.xsl @@ -0,0 +1,13 @@ + + + + + + +\ +. + + diff --git a/tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl b/tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl new file mode 100644 index 000000000000..a63c7632a87d --- /dev/null +++ b/tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile index f65243137d6d..3764e003d1cc 100644 --- a/tools/lib/traceevent/Makefile +++ b/tools/lib/traceevent/Makefile @@ -53,6 +53,7 @@ pkgconfig_dir ?= $(word 1,$(shell $(PKG_CONFIG) \ export man_dir man_dir_SQ INSTALL export DESTDIR DESTDIR_SQ +export EVENT_PARSE_VERSION set_plugin_dir := 1 @@ -313,6 +314,18 @@ clean: $(RM) TRACEEVENT-CFLAGS tags TAGS; \ $(RM) $(PKG_CONFIG_FILE) +doc: + $(call descend,Documentation) + +doc-clean: + $(call descend,Documentation,clean) + +doc-install: + $(call descend,Documentation,install) + +doc-uninstall: + $(call descend,Documentation,uninstall) + PHONY += force plugins force: From patchwork Fri Mar 8 13:36:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844753 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 108481390 for ; Fri, 8 Mar 2019 13:37:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F04CA2E40A for ; Fri, 8 Mar 2019 13:37:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E494B2E440; Fri, 8 Mar 2019 13:37:01 +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 8F31C2E40A for ; Fri, 8 Mar 2019 13:37:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbfCHNhB (ORCPT ); Fri, 8 Mar 2019 08:37:01 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:34090 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfCHNhA (ORCPT ); Fri, 8 Mar 2019 08:37:00 -0500 Received: by mail-wm1-f67.google.com with SMTP id o10so8975603wmc.1 for ; Fri, 08 Mar 2019 05:36:59 -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=Lp0vFYrBBBMX0fIItrHSvdGAAmrdEmflDRuI95m5iNk=; b=FpT7uldmcjoMpdTXgnvl35bExXbU2cJQN0TqCH6XMBVW+g9D78vurVvbzIEJoGq3N3 CDUgHIG9mYs1lUx+vGXdi1a+XD9qiLaxkE5drvM4Gn/CIgt2sTd9WvKUO2r+plOMbEBw veHzR9bgNhQhFEo9t0PS8jgsOsE4CC1a8H+yWKBmYPqMcEXOE9rpEPVekSszhlgxvMl9 pZgdVx7faeJonp3MpH/19KpTMPR58H9u1YH68qCaE3jjX/e0u2RCRYu8VkRM9cEygsnk 4MeNR+ks16syKYRQGw4lt8MaiqtLPJRyuOk9GsH69NK+FEM90H8LKZQFjZRwvRRFwiY7 8D6A== X-Gm-Message-State: APjAAAVE79ePvSPprvLWGl/mXRtvYE9tnu+GmMeQS32MMFvRBrdD4fZ8 qJ9Zlf30YG76PbhgOpZfMxk= X-Google-Smtp-Source: APXvYqyk040iFBqXlVNQggkjNcQvO8LzKW7f+y6PwvngA7t40jedqDr4boICmqDYJrOjagSwygk4tQ== X-Received: by 2002:a7b:c41a:: with SMTP id k26mr9752388wmi.6.1552052219149; Fri, 08 Mar 2019 05:36:59 -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.36.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:36:58 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 02/46] tools/lib/traceevent: Fix libtraceevent/Documentation Makefile Date: Fri, 8 Mar 2019 15:36:10 +0200 Message-Id: <20190308133654.21264-3-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 As libtraceevent/Documentation Makefile and all XLS files were taken from tools/perf/Documentation, and modified for libtraceevent, this patch adds a note on the top of the Makefile to state it. It also fixes the "clean" rule, to clean up compiled man pages. Signed-off-by: Tzvetomir Stoyanov --- tools/lib/traceevent/Documentation/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/lib/traceevent/Documentation/Makefile b/tools/lib/traceevent/Documentation/Makefile index e17c0723b4e1..680a9771067f 100644 --- a/tools/lib/traceevent/Documentation/Makefile +++ b/tools/lib/traceevent/Documentation/Makefile @@ -1,6 +1,9 @@ include ../../../scripts/Makefile.include include ../../../scripts/utilities.mak +# This Makefile and manpage XSL files were taken from tools/perf/Documentation +# and modified for libtraceevent. + MAN3_TXT= \ $(wildcard libtraceevent-*.txt) \ libtraceevent.txt @@ -174,7 +177,7 @@ endif CLEAN_FILES = \ $(MAN_XML) $(addsuffix +,$(MAN_XML)) \ $(MAN_HTML) $(addsuffix +,$(MAN_HTML)) \ - $(DOC_MAN3) + $(DOC_MAN3) *.3 clean: $(call QUIET_CLEAN, Documentation) $(RM) $(CLEAN_FILES) From patchwork Fri Mar 8 13:36:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844755 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 F16651869 for ; Fri, 8 Mar 2019 13:37:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF4772E435 for ; Fri, 8 Mar 2019 13:37:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D40182E466; Fri, 8 Mar 2019 13:37:02 +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 6D3362E435 for ; Fri, 8 Mar 2019 13:37:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726546AbfCHNhC (ORCPT ); Fri, 8 Mar 2019 08:37:02 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36519 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726432AbfCHNhB (ORCPT ); Fri, 8 Mar 2019 08:37:01 -0500 Received: by mail-wr1-f68.google.com with SMTP id o17so21410370wrw.3 for ; Fri, 08 Mar 2019 05:37:00 -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=XHn3UWNZM7i1w8ucxIPLnxbQZGyZGc0g5+b1bKqN2XE=; b=DeGMgFzlPLQo875jMbABvAi1WGVlWe8ZyfXYC63rFHQt50c/gaSB5YMZ2GDRb9QKUU uPOrg5DDldjRquo6YZTxLtVny2pX0zAmangdS/he/tuSYOHCvLSiWkPFZdxx6lwC9gwZ kmFV94bn2iiemYi7aigBzlsjZH3fb8TUFjVn74gtm5ZT3+5J10V2gmddhLvaJnrUyjK4 uK+DnBQMxbhnGrAzTFIkraHsmou/RifL5lBfWIcxKbbiROoGOEqlI5wcL3+RCKusjWpK owjs/QTviLvSiSmCpQ/U31msa3oQorRM6+U2oTciF5YwQ/fVfUXrF2ulxeoT3Acv4xsc 40Rg== X-Gm-Message-State: APjAAAXYQ3D/JZ6RzQQw1h0A8bq0/hOKlRsXbMwDMohQw2x0ehkTbQog VM6YW/J4fQEJsY2Or84NUrqEJTxU X-Google-Smtp-Source: APXvYqxdD+aF/+mU+H5LtkxyxFrMY7kTc+0136zg06dx0O1AZRgK6rA8OoPpkYBP6LkiQ1GeIbjVWA== X-Received: by 2002:adf:afe3:: with SMTP id y35mr10838839wrd.318.1552052220103; Fri, 08 Mar 2019 05:37:00 -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.36.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:36:59 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 03/46] tools/lib/traceevent: Add support for man pages with multiple names Date: Fri, 8 Mar 2019 15:36:11 +0200 Message-Id: <20190308133654.21264-4-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 This patch adds support for man pages with multiple names, used to combine the description of several APIs into one page. Signed-off-by: Tzvetomir Stoyanov --- .../traceevent/Documentation/asciidoc.conf | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/tools/lib/traceevent/Documentation/asciidoc.conf b/tools/lib/traceevent/Documentation/asciidoc.conf index 1b03c63fb73a..07595717f06e 100644 --- a/tools/lib/traceevent/Documentation/asciidoc.conf +++ b/tools/lib/traceevent/Documentation/asciidoc.conf @@ -74,12 +74,41 @@ template::[header-declarations] {mantitle} {manvolnum} -trace-cmd +libtraceevent {libtraceevent_version} -trace-cmd Manual +libtraceevent Manual - {manname} + {manname1} + {manname2} + {manname3} + {manname4} + {manname5} + {manname6} + {manname7} + {manname8} + {manname9} + {manname10} + {manname11} + {manname12} + {manname13} + {manname14} + {manname15} + {manname16} + {manname17} + {manname18} + {manname19} + {manname20} + {manname21} + {manname22} + {manname23} + {manname24} + {manname25} + {manname26} + {manname27} + {manname28} + {manname29} + {manname30} {manpurpose} endif::backend-docbook[] From patchwork Fri Mar 8 13:36:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844759 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 956EC1803 for ; Fri, 8 Mar 2019 13:37:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82A882E435 for ; Fri, 8 Mar 2019 13:37:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 773CA2E466; Fri, 8 Mar 2019 13:37:03 +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 2DD502E435 for ; Fri, 8 Mar 2019 13:37:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726648AbfCHNhD (ORCPT ); Fri, 8 Mar 2019 08:37:03 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44793 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfCHNhC (ORCPT ); Fri, 8 Mar 2019 08:37:02 -0500 Received: by mail-wr1-f68.google.com with SMTP id w2so21388042wrt.11 for ; Fri, 08 Mar 2019 05:37:01 -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=h9MiVW5SrsZXPilLHLFVo9fbjYkliDvYY0uGLBPbjk0=; b=WvghQ/GjYhPa20IcDHIfq0uLLILZRBJ6oS6/J8E5dUn24VFG85VnqTGKWlmPpuwcaW uCul1YNgmjZGDpedVMG+NJFyv5bbK+YNw+eWgCaHMpu4H9eTOfuqQofPXNoVVdLS9Bp9 0nit036rd2LYGo6jXG3cvqWf2OpGm7M6HGyM0Z60osfa0kWDiNNqngmMpyIUAXYO6okx s9SNFrDs+8vvursV3jc8CYI679GVJSWma6Cw6elllMUes/V12iH6/t6xWe6UoMTvbOjS 1cilWZ54oRuPAVQi8R6FrmdeOz2CMCcCX2otM1zqwL4JyUXXR9onzuo2c4jascob0o6t 2mUA== X-Gm-Message-State: APjAAAVZqX5iVmqk4JkgeHHOxeYrVkzKl42+Bh5ullKQRJ8ZbOkPObpa 201wSv/2iwfeLiaBq25xI2M= X-Google-Smtp-Source: APXvYqytR2UYZBoe/DMfmfHHpDPXYS/bqmQlCyh4iV6aVuDh8XtPY+dMImPhqsTR1xZ+oETf75sgNw== X-Received: by 2002:adf:edd1:: with SMTP id v17mr11103648wro.300.1552052221092; Fri, 08 Mar 2019 05:37:01 -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.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:00 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 04/46] tools/lib/traceevent: libtraceevent Makefile "help" target Date: Fri, 8 Mar 2019 15:36:12 +0200 Message-Id: <20190308133654.21264-5-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 This patch adds a new target to the traceevent Makefile - "help". "make help" prints a description of all targets, supported by the Makefile. Signed-off-by: Tzvetomir Stoyanov --- tools/lib/traceevent/Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile index 3764e003d1cc..0853861d0cd2 100644 --- a/tools/lib/traceevent/Makefile +++ b/tools/lib/traceevent/Makefile @@ -326,6 +326,21 @@ doc-install: doc-uninstall: $(call descend,Documentation,uninstall) +help: + @echo 'Possible targets:' + @echo'' + @echo ' all - default, compile the library and the'\ + 'plugins' + @echo ' plugins - compile the plugins' + @echo ' install - install the library, the plugins,'\ + 'the header and pkgconfig files' + @echo ' clean - clean the library and the plugins object files' + @echo ' doc - compile the documentation files - man'\ + 'and html pages, in the Documentation directory' + @echo ' doc-clean - clean the documentation files' + @echo ' doc-install - install the man pages' + @echo ' doc-uninstall - uninstall the man pages' + @echo'' PHONY += force plugins force: From patchwork Fri Mar 8 13:36:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844765 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 490C317E9 for ; Fri, 8 Mar 2019 13:37:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 341032E40A for ; Fri, 8 Mar 2019 13:37:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 263662E440; Fri, 8 Mar 2019 13:37:06 +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 1CCB02E40A for ; Fri, 8 Mar 2019 13:37:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726651AbfCHNhE (ORCPT ); Fri, 8 Mar 2019 08:37:04 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45886 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726432AbfCHNhE (ORCPT ); Fri, 8 Mar 2019 08:37:04 -0500 Received: by mail-wr1-f65.google.com with SMTP id o7so1292729wrp.12 for ; Fri, 08 Mar 2019 05:37:02 -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=YUJimhnn2hP5sapmqv6BEW3j42jdpxpGDBL0ddNbXWo=; b=mxLTxH1u+DzT4391OViVNkRYH8WlgLSsLgG24UMbXs/GcnAp4Gak/Bm+c7ZWFmSwhn +uInTr1oO8ZMlObuFdRQlrZni2Rsn9lmQMcU37D+1MDhax5cRjZf6RQ4nc0NeOmUn0wB rYW09kmrttxdVBJokofRmAGSrTnz5bBgR6/vrdqiNBUSYMe2gwOgs/8I5F03J4JO57w9 paYp7YwJAqps03HExTV9A6jp4hHhxw7txMST7AGE/6YyV0+x11mGT21J9O/zNUKqnN4w ej9uw+IzR0A2tQFWC5qLJF7CzcXNgOQCAdTMaXfjA42f7AKCn+7rOcDF/C8y6cAFyCO9 fDSQ== X-Gm-Message-State: APjAAAUJie/6xZs5uCec49sRRtE9/EbsjVP+E64vt7FBHRst288pj3rE 1ylpJ4L8zZG6Oo5YwdYmlWg= X-Google-Smtp-Source: APXvYqyjGnJQfP8X0n1Z6xVNU9cne5Vf8cQ23ya8Al2WF4RrLiIt2GxinTQYu+aw6V7FsIsdZFFnlA== X-Received: by 2002:adf:812a:: with SMTP id 39mr11242179wrm.48.1552052221976; Fri, 08 Mar 2019 05:37:01 -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.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:01 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 05/46] tools/lib/traceevent: libtraceevent man pages for tep_handler related APIs Date: Fri, 8 Mar 2019 15:36:13 +0200 Message-Id: <20190308133654.21264-6-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 This patch adds 4 new man pages for: tep_register_comm,tep_pid_is_registered,tep_data_comm_from_pid, tep_data_pid_from_comm,tep_cmdline_pid,tep_alloc,tep_free,tep_get_long_size, tep_set_long_size,tep_set_flag, as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-commands.txt | 130 ++++++++++++++++++ .../Documentation/libtraceevent-handle.txt | 101 ++++++++++++++ .../Documentation/libtraceevent-long_size.txt | 78 +++++++++++ .../Documentation/libtraceevent-set_flag.txt | 90 ++++++++++++ 4 files changed, 399 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-commands.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-handle.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-long_size.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-commands.txt b/tools/lib/traceevent/Documentation/libtraceevent-commands.txt new file mode 100644 index 000000000000..2db014d51d2c --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-commands.txt @@ -0,0 +1,130 @@ +libtraceevent(3) +================ + +NAME +---- +tep_register_comm,tep_pid_is_registered,tep_data_comm_from_pid,tep_data_pid_from_comm,tep_cmdline_pid - handle pid to process name mappings + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_register_comm*(struct tep_handle pass:[*]_tep_, const char pass:[*]_comm_, int _pid_); +int *tep_pid_is_registered*(struct tep_handle pass:[*]_tep_, int _pid_); +const char pass:[*]*tep_data_comm_from_pid*(struct tep_handle pass:[*]_pevent_, int _pid_); +struct cmdline pass:[*]*tep_data_pid_from_comm*(struct tep_handle pass:[*]_pevent_, const char pass:[*]_comm_, struct cmdline pass:[*]_next_); +int *tep_cmdline_pid*(struct tep_handle pass:[*]_pevent_, struct cmdline pass:[*]_cmdline_); +-- + +DESCRIPTION +----------- +These functions can be used to handle the mapping between pid and process name. +The library builds a cache of these mappings, which is used to display the name of +the process, instead of its pid. This information can be retrieved from +tracefs/saved_cmdlines file. + +The _tep_register_comm()_ function registers a pid / process name mapping. +The _pid_ argument is the process ID, the _comm_ argument is the process name, +_tep_ is the event context. The _comm_ is copied internally. + +The _tep_pid_is_registered()_ function checks if a pid has a process name mapping +registered. The _pid_ argument is the process ID, _tep_ is the event context. + +The _tep_data_comm_from_pid()_ function returns the process name for a given pid. +The _pid_ argument is the process ID, _tep_ is the event context. The returned +string should not be freed, but will be freed when the _tep_ handler is closed. + +The _tep_data_pid_from_comm()_ function returns a pid for a given process name. +The _comm_ argument is the process name, _tep_ is the event context. +The argument _next_ is the cmdline structure to search for the next pid. +As there may be more than one pid for a given process, the result of this call +can be passed back into a recurring call in the _next_ parameter, to search for +the next pid. If _next_ is NULL, it will return the first pid associated with +the _comm_. The function performs a linear search, so it may be slow. + +The _tep_cmdline_pid()_ function returns the pid associated with a given _cmdline_. +The _tep_ argument is the event context. + +RETURN VALUE +------------ +_tep_register_comm()_ function returns 0 on success, or -1 in case of an error. + +_tep_pid_is_registered()_ function returns 1 if the _pid_ has a process name +mapped to it, 0 otherwise. + +_tep_data_comm_from_pid()_ function returns the process name as string, or the +string "<...>" if there is no mapping for the given pid. + +_tep_data_pid_from_comm()_ function returns a pointer to a struct cmdline, that +holds a pid for a given process, or NULL if none is found. This result can be +passed back into a recurring call as the _next_ parameter of the function. + +_tep_cmdline_pid()_ functions returns the pid for the give cmdline. If _cmdline_ + is NULL, then -1 is returned. + +EXAMPLE +------- +The following example registers pid for command "ls", in context of event _tep_ +and performs various searches for pid / process name mappings: +[source,c] +-- +#include +... +int ls_pid = 1021; +struct tep_handle *tep = tep_alloc(); +... + if (tep_register_comm(tep, "ls", ls_pid) != 0) { + /* Failed to register pid / command mapping */ + } +.... + if (tep_pid_is_registered(tep, ls_pid) == 0) { + /* Command mapping for ls_pid is not registered */ + } +... + const char *comm = tep_data_comm_from_pid(tep, ls_pid); + if (comm) { + /* Found process name for ls_pid */ + } +... + int pid; + struct cmdline *cmd = tep_data_pid_from_comm(tep, "ls", NULL); + while (cmd) { + pid = tep_cmdline_pid(tep, cmd); + /* Found pid for process "ls" */ + cmd = tep_data_pid_from_comm(tep, "ls", cmd); + } +-- +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 diff --git a/tools/lib/traceevent/Documentation/libtraceevent-handle.txt b/tools/lib/traceevent/Documentation/libtraceevent-handle.txt new file mode 100644 index 000000000000..7e1abe4dcda2 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-handle.txt @@ -0,0 +1,101 @@ +libtraceevent(3) +================ + +NAME +---- +tep_alloc,tep_free,tep_ref,tep_unref,tep_ref_get - Create, destroy, manage +references of trace event parser context. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +struct tep_handle pass:[*]*tep_alloc*(void); +void *tep_free*(struct tep_handle pass:[*]_tep_); +void *tep_ref*(struct tep_handle pass:[*]_tep_); +void *tep_unref*(struct tep_handle pass:[*]_tep_); +int *tep_ref_get*(struct tep_handle pass:[*]_tep_); +-- + +DESCRIPTION +----------- +These are the main functions to create and destroy tep_handle - the main +structure, representing the trace event parser context. This context is used as +the input parameter of most library APIs. + +The _tep_alloc()_ function allocates and initializes the tep context. + +The _tep_free()_ function will decrement the reference of the _tep_ handler. +When there is no more references, then it will free the handler, as well +as clean up all its resources that it had used. The argument _tep_ is +the pointer to the trace event parser context. + +The _tep_ref()_ function adds a reference to the _tep_ handler. + +The _tep_unref()_ function removes a reference from the _tep_ handler. When +the last reference is removed, the _tep_ is destroyed, and all resources that +it had used are cleaned up. + +The _tep_ref_get()_ functions gets the current references of the _tep_ handler. + +RETURN VALUE +------------ +_tep_alloc()_ returns a pointer to a newly created tep_handle structure. +NULL is returned in case there is not enough free memory to allocate it. + +_tep_ref_get()_ returns the current references of _tep_. +If _tep_ is NULL, 0 is returned. + +EXAMPLE +------- +[source,c] +-- +#include + +... +struct tep_handle *tep = tep_alloc(); +... +int ref = tep_ref_get(tep); +tep_ref(tep); +if ( (ref+1) != tep_ref_get(tep)) { + /* Something wrong happened, the counter is not incremented by 1 */ +} +tep_unref(tep); +... +tep_free(tep); +... +-- +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 diff --git a/tools/lib/traceevent/Documentation/libtraceevent-long_size.txt b/tools/lib/traceevent/Documentation/libtraceevent-long_size.txt new file mode 100644 index 000000000000..7cd69146d053 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-long_size.txt @@ -0,0 +1,78 @@ +libtraceevent(3) +================ + +NAME +---- +tep_get_long_size,tep_set_long_size - Get / set the size of a long integer on +the machine, where the trace is generated, in bytes + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_get_long_size*(strucqt tep_handle pass:[*]_tep_); +void *tep_set_long_size*(struct tep_handle pass:[*]_tep_, int _long_size_); +-- + +DESCRIPTION +----------- +The _tep_get_long_size()_ function returns the size of a long integer on the machine, +where the trace is generated. The _tep_ argument is trace event parser context. + +The _tep_set_long_size()_ function sets the size of a long integer on the machine, +where the trace is generated. The _tep_ argument is trace event parser context. +The _long_size_ is the size of a long integer, in bytes. + +RETURN VALUE +------------ +The _tep_get_long_size()_ function returns the size of a long integer on the machine, +where the trace is generated, in bytes. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +tep_set_long_size(tep, 4); +... +int long_size = tep_get_long_size(tep); +... +-- + +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 diff --git a/tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt b/tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt new file mode 100644 index 000000000000..815b54156a57 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt @@ -0,0 +1,90 @@ +libtraceevent(3) +================ + +NAME +---- +tep_set_flag - Set a flag or combination of flags of trace event parser context + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum *tep_flag* { + _TEP_NSEC_OUTPUT_, + _TEP_DISABLE_SYS_PLUGINS_, + _TEP_DISABLE_PLUGINS_ +}; +void *tep_set_flag*(struct tep_handle pass:[*]_tep_, int _flag_); +-- + +DESCRIPTION +----------- +[verse] +-- +The _tep_set_flag()_ function sets _flag_ or any combination of flags to _tep_ context. +Flags are defined in *enum tep_flag*: + _TEP_NSEC_OUTPUT_ - print event's timestamp in nano seconds, instead of micro seconds. + _TEP_DISABLE_SYS_PLUGINS_ - disable plugins, located in system's plugin directory. + This directory is defined at library compile time, and usually + depends on library installation prefix: (install_preffix)/lib/traceevent/plugins + _TEP_DISABLE_PLUGINS_ - disable all library plugins: + - in system's plugin directory + - in directory, defined by the environment variable _TRACEEVENT_PLUGIN_DIR_ + - in user's home directory, _~/.traceevent/plugins_ + +Note: plugin related flags must me set before calling _tep_load_plugins()_ API. +-- + +RETURN VALUE +------------ +_tep_set_flag()_ functions has no return value. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +/* Set printing of timestamps in nano seconds and disable system plugins */ +tep_set_flag(tep, TEP_NSEC_OUTPUT | TEP_DISABLE_SYS_PLUGINS); +... +/* Disable all library plugins */ +tep_set_flag(tep, TEP_DISABLE_PLUGINS); +... +-- +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 From patchwork Fri Mar 8 13:36:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844763 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 CBEE71390 for ; Fri, 8 Mar 2019 13:37:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B88AB2E435 for ; Fri, 8 Mar 2019 13:37:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACECA2E466; Fri, 8 Mar 2019 13:37:05 +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 520D02E435 for ; Fri, 8 Mar 2019 13:37:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726432AbfCHNhF (ORCPT ); Fri, 8 Mar 2019 08:37:05 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36522 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbfCHNhE (ORCPT ); Fri, 8 Mar 2019 08:37:04 -0500 Received: by mail-wr1-f66.google.com with SMTP id o17so21410555wrw.3 for ; Fri, 08 Mar 2019 05:37:03 -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=O8Ihw8mfOqn4HmP/IhUtDZYk7yYKQJVm+yP9ixou6+c=; b=ghPN/79vecrvfTJ2uB7wHwspmMGPCZsvGIGi9iFPVKr9/wFQhCnYNfd/3t/d833T2h r2lRz/hfR65DthKesAyq/rpZsKRamqVCwTcMi33x9I9niWlnkajEGXRT7mmCBHW5k7Sa d0kS3iyBL9AEt+rvXQrxQFvd3/PgXFItmV05aTIv4VzlZWxbfIz1cT+Io4mYlJzsspzb 94ETYSPxkOzr5ZK3CSnBKdbiKLfLN4qpKh3cf/BBGHdHDw0XzbvfYk5PxLTIwvFH8T+5 Sw8cJl3nXuCOyoDGw48S92ekUeY5CVSfzRexw9uNa2rVn/85KFMkKt65TNJrmay/9ABG JtIA== X-Gm-Message-State: APjAAAW2o3Hh+tZfbvc33jFqa2aoWVHuLXuUZde0FAXrABrNCFc9P1jY 7mEs7cKBBw2I/E/pJkNp9Jlt/EKs X-Google-Smtp-Source: APXvYqyP14M+Ly7xAbPHZCx2paprdCfxK3GwSVDVwtZJZq4bVg8D487s7Igzh1oQLyP7BLviIMg9BQ== X-Received: by 2002:adf:9f54:: with SMTP id f20mr11289100wrg.88.1552052223221; Fri, 08 Mar 2019 05:37:03 -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.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:02 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 06/46] tools/lib/traceevent: Man page for tep_get_header_page_size() Date: Fri, 8 Mar 2019 15:36:14 +0200 Message-Id: <20190308133654.21264-7-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 a man page for tep_get_header_page_size(), as part of the libtraceevent API. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-header_size.txt | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-header_size.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-header_size.txt b/tools/lib/traceevent/Documentation/libtraceevent-header_size.txt new file mode 100644 index 000000000000..5810a4cdc2ea --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-header_size.txt @@ -0,0 +1,73 @@ +libtraceevent(3) +================ + +NAME +---- +tep_get_header_page_size - Get the size of a long integer, in kernel context. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_get_header_page_size*(struct tep_handle pass:[*]_tep_); + +-- +DESCRIPTION +----------- +The _tep_get_header_page_size()_ function returns the size of a long integer, +in kernel context. The _tep_ argument is trace event parser context. +This information is retrieved from /sys/kernel/debug/tracing/events/header_page, + "commit" field. + +RETURN VALUE +------------ +The _tep_get_header_page_size()_ function returns the size of a long integer, +in bytes + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + int lsize = tep_get_header_page_size(tep); + printf ("The size of a long in kernel context is %d bytes", lsize); +... +-- + +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 From patchwork Fri Mar 8 13:36:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844767 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 C69001390 for ; Fri, 8 Mar 2019 13:37:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B37942E40A for ; Fri, 8 Mar 2019 13:37:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A78E72E435; Fri, 8 Mar 2019 13:37:06 +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 4466B2E466 for ; Fri, 8 Mar 2019 13:37:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726656AbfCHNhG (ORCPT ); Fri, 8 Mar 2019 08:37:06 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42260 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfCHNhF (ORCPT ); Fri, 8 Mar 2019 08:37:05 -0500 Received: by mail-wr1-f65.google.com with SMTP id r5so21381584wrg.9 for ; Fri, 08 Mar 2019 05:37:04 -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=yDsZQCexNNc3rXFxrnpxWHKlQyJ2cryg7sPkRlHW4F8=; b=BntHUJWG8ZUIjX9NiOENeFADhVw8UxibK1q2kKrPvby+mWuW1PnQYZZF5rW84+eVyG 6Uk00sZ/T08NHCjfYXhY/3H1uQrTrM2Yo5KkNnhyOlat78nvWyBRUZAOjWrNqBBPMKOC sA8ScivxqpvZyg2fpxVN75Uw9YZcA9LX9JHqWrLrf0fDEt2t+J/yJj99LgW9t2e1CTMW h+XogpcqXzvQOhaZWEMtjPCr2MrBuUhgDKxoIpMZFkMEaxI06PMCNoqzg4zfuRwL0a55 U3MJX2lvgBZYn890ULQSajSKgjWubTwr1ax89rKmn1eDX6H4jF+FcpBNs//B/0fh6Zn7 X2XA== X-Gm-Message-State: APjAAAWII9qTYm0IR/JN9bQg7YddyoZr+gD2/vm3OZp0kUumj8iEWV1n LzZ7ZgHF2KwFEEhh9RMJ/9U= X-Google-Smtp-Source: APXvYqxOa/TNY+16eIV/0hvVV7YsWG6LCO7hyt00hg0IIPJeZgVkWxL29DtQw4rYAlFREd18ymKVaA== X-Received: by 2002:adf:f711:: with SMTP id r17mr2900333wrp.38.1552052224242; Fri, 08 Mar 2019 05:37:04 -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.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:03 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 07/46] tools/lib/traceevent: Man page for tep_get_cpus() and tep_set_cpus() Date: Fri, 8 Mar 2019 15:36:15 +0200 Message-Id: <20190308133654.21264-8-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_get_cpus() and tep_set_cpus() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-cpus.txt | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-cpus.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-cpus.txt b/tools/lib/traceevent/Documentation/libtraceevent-cpus.txt new file mode 100644 index 000000000000..dab361517ad1 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-cpus.txt @@ -0,0 +1,77 @@ +libtraceevent(3) +================ + +NAME +---- +tep_get_cpus,tep_set_cpus - Get / set the number of CPUs, which have a tracing +buffer representing it. Note, the buffer may be empty. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_get_cpus*(struct tep_handle pass:[*]_tep_); +void *tep_set_cpus*(struct tep_handle pass:[*]_tep_, int _cpus_); +-- + +DESCRIPTION +----------- +The _tep_get_cpus()_ function gets the number of CPUs, which have a tracing +buffer representing it. The _tep_ argument is trace event parser context. + +The _tep_set_cpus()_ function sets the number of CPUs, which have a tracing +buffer representing it. The _tep_ argument is trace event parser context. +The _cpu_ argument is the number of CPUs with tracing data. + +RETURN VALUE +------------ +The _tep_get_cpus()_ functions returns the number of CPUs, which have tracing +data recorded. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + tep_set_cpus(tep, 5); +... + printf("We have tracing data for %d CPUs", tep_get_cpus(tep)); +-- + +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 From patchwork Fri Mar 8 13:36:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844769 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 B2E591390 for ; Fri, 8 Mar 2019 13:37:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FF802E40A for ; Fri, 8 Mar 2019 13:37:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 944DD2E440; Fri, 8 Mar 2019 13:37:07 +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 2E4F42E40A for ; Fri, 8 Mar 2019 13:37:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbfCHNhH (ORCPT ); Fri, 8 Mar 2019 08:37:07 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44799 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbfCHNhG (ORCPT ); Fri, 8 Mar 2019 08:37:06 -0500 Received: by mail-wr1-f68.google.com with SMTP id w2so21388288wrt.11 for ; Fri, 08 Mar 2019 05:37:05 -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=aletairNhlEzzFH9xAKeQ7wEWMGcR7jiUaW1MBOH/ns=; b=fHvlkjWM8e33MkUz3jD89KYtSuk/dOBlmAMzpa34D9iEd9F9nBUFArxRDqreHM7ZXl jvJKaLjRzBe8Auf7aLdL/3dVNqmjDXM487JdzPpYbGXm0UGTM/HwQzQbHBDeKfpNqW/Z Q3cFVSsMfxCP715vRsELztvn+IHzsC8CJ69BGQJhwwEa7hExqcQ3HvOWwK4VLvoWe+Ia XQccKlgRk/R3M1BDrdR95e2SzMqP5Xt+BK6GO2T6f/F9TKY8enV/mP2/0uz7WoFv+Fcu 8IwtNMXQgeM33VmkXLv5gu3yXD9wgB5YI6J36KENyqCWSOaUGJK+Ic2qlPv7I8PqPBr0 vjvA== X-Gm-Message-State: APjAAAUrJzKRuM3l2H1c7PnWG/HmVotkjbn0vuiuXdo2eHgdzLK6EmDe Slst37gUBjLcQdM+x9D86bRbSK1c X-Google-Smtp-Source: APXvYqzbA9d568OPKAI9oLXRJ/000BlrsVh8HmhFYIp7ZnHHlGKFomntfuKcB6w5T3AGVgx/wzTurg== X-Received: by 2002:adf:d84c:: with SMTP id k12mr1976387wrl.58.1552052225122; Fri, 08 Mar 2019 05:37:05 -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.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:04 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 08/46] tools/lib/traceevent: Man page for tep_is_file_bigendian() and tep_set_file_bigendian() Date: Fri, 8 Mar 2019 15:36:16 +0200 Message-Id: <20190308133654.21264-9-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_is_file_bigendian() and tep_set_file_bigendian() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-file_endian.txt | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt b/tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt new file mode 100644 index 000000000000..2f37d151fa95 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt @@ -0,0 +1,89 @@ +libtraceevent(3) +================ + +NAME +---- +tep_file_bigendian,tep_set_file_bigendian - Get / set the endianness of the +raw data being accessed by the tep handler. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum *tep_endian* { + TEP_LITTLE_ENDIAN = 0, + TEP_BIG_ENDIAN +}; + +int *tep_file_bigendian*(struct tep_handle pass:[*]_tep_); +void *tep_set_file_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_); + +-- +DESCRIPTION +----------- +The _tep_file_bigendian()_ function returns the endianness of the raw data, +being accessed by the tep handler. The _tep_ argument is trace event parser context. + +The _tep_set_file_bigendian()_ set the endianness of raw data being accessed +by the tep handler. The _tep_ argument is trace event parser context. +[verse] +-- +The _endian_ argument is the endianness: + _TEP_LITTLE_ENDIAN_ - the raw data is in little endian format, + _TEP_BIG_ENDIAN_ - the raw data is in big endian format. +-- +RETURN VALUE +------------ +The _tep_file_bigendian()_ function returns _TEP_LITTLE_ENDIAN_ or _TEP_BIG_ENDIAN_. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + tep_set_file_bigendian(tep, TEP_LITTLE_ENDIAN); +... + if (TEP_BIG_ENDIAN == tep_file_bigendian(tep)) { + /* The raw data is in big endian */ + } else { + /* The raw data is in little endian */ + } +-- + +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 From patchwork Fri Mar 8 13:36:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844771 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 2058A17E9 for ; Fri, 8 Mar 2019 13:37:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D3AE2E40A for ; Fri, 8 Mar 2019 13:37:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 017EB2E440; Fri, 8 Mar 2019 13:37:08 +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 922962E40A for ; Fri, 8 Mar 2019 13:37:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726661AbfCHNhI (ORCPT ); Fri, 8 Mar 2019 08:37:08 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36139 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfCHNhI (ORCPT ); Fri, 8 Mar 2019 08:37:08 -0500 Received: by mail-wm1-f65.google.com with SMTP id j125so12490722wmj.1 for ; Fri, 08 Mar 2019 05:37:06 -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=EguOzs7yESnH6Jymq7twdKCOGCQJBqvt7aeCpQRnT1c=; b=pWpVXY/rOUu1twNOe3CxAn3604BLqvoiCy0KoGInWPPWOo0bOZrwwR+Ta+o/tIB0I8 ooDiIKuGRFNTSVytCJoh8cEQuenE/80tUgUOxHCSnuhgVWiX4s9v0O7/yVuF4iKCaLpF vXfexLSVcgrG7tinRwGyGfDzDG8Hc2p6K7CJGyVh+ZGxzhMkM/pIR4/vx4mi/ByZq16q /dlyKEnScHYtVZPUhiZQAU+wpZuOR7uTE89rc1RnvgtsTsm8jU08Wft7+gNQ1RgTPlwZ FbKmKvVUte4UYwzmx66ZFbG0ssrdLoSdyDCXD2hAHu0AR3bjTX21r88UKndIEWdz3/ap peXQ== X-Gm-Message-State: APjAAAVaYtus2BwWQcQqGIZWXCaKjOa6cRxYGpOjbB7OqRbtTHA9gaRn rnQKQGaqHah7miwN4JJ//RwUgjsK X-Google-Smtp-Source: APXvYqz16G6wI+P2Vzk+rcoOLY8dYLdXeXDxlyZx7juawPPC41KRfthrohlTSolikVYr5GeJv3wFxw== X-Received: by 2002:a05:600c:2115:: with SMTP id u21mr9716660wml.70.1552052226040; Fri, 08 Mar 2019 05:37:06 -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.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:05 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 09/46] tools/lib/traceevent: Man page for tep_is_host_bigendian() and tep_set_host_bigendian() Date: Fri, 8 Mar 2019 15:36:17 +0200 Message-Id: <20190308133654.21264-10-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_is_host_bigendian() and tep_set_host_bigendian() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-host_endian.txt | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt b/tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt new file mode 100644 index 000000000000..de2aab90c8cf --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt @@ -0,0 +1,91 @@ +libtraceevent(3) +================ + +NAME +---- +tep_is_host_bigendian,tep_set_host_bigendian,tep_host_bigendian - Get / set the +endianness of the machine running the current code. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum *tep_endian* { + TEP_LITTLE_ENDIAN = 0, + TEP_BIG_ENDIAN +}; + +int *tep_is_host_bigendian*(struct tep_handle pass:[*]_tep_); +void *tep_set_host_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_); +int tep_host_bigendian(void); +-- + +DESCRIPTION +----------- +The _tep_is_host_bigendian()_ function returns the endianness of the the machine +running the current code. The _tep_ argument is the trace event parser context. + +The _tep_set_host_bigendian()_ set the endianness of the machine running the code. +The _tep_ argument is trace event parser context. The _endian_ argument is the +endianness: +[verse] +-- + _TEP_LITTLE_ENDIAN_ - the machine is little endian, + _TEP_BIG_ENDIAN_ - the machine is big endian. +-- + +RETURN VALUE +------------ +The _tep_is_host_bigendian()_ function returns _TEP_LITTLE_ENDIAN_ or _TEP_BIG_ENDIAN_. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + tep_set_host_bigendian(tep, TEP_LITTLE_ENDIAN); +... + if (TEP_BIG_ENDIAN == tep_is_host_bigendian(tep)) { + /* The local host is big endian */ + } else { + /* The local host is little endian */ + } +-- + +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 From patchwork Fri Mar 8 13:36:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844773 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 E6E8E17E9 for ; Fri, 8 Mar 2019 13:37:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D339C2E40A for ; Fri, 8 Mar 2019 13:37:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C78772E440; Fri, 8 Mar 2019 13:37:09 +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 490032E40A for ; Fri, 8 Mar 2019 13:37:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726675AbfCHNhJ (ORCPT ); Fri, 8 Mar 2019 08:37:09 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53910 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbfCHNhJ (ORCPT ); Fri, 8 Mar 2019 08:37:09 -0500 Received: by mail-wm1-f66.google.com with SMTP id e74so12566363wmg.3 for ; Fri, 08 Mar 2019 05:37:07 -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=e+1D0rjAi1cZiOqo1mIduUIu3Cyi19E08jFbilxQE2w=; b=hfkF/Cjc9Bs6li8jSCIODJazAESY8WRXUz0vSq+g+vucnH6m1SeTlJNmSugV3N8be8 qXK35N9YarMpWJBFmUQYif5KUwdO6sQ+H6BntXzrQqBgbfSP1pr2DTX9dYWnZGJOlWHL WMy/ZYhLzuETZmIkec7Kqlk3FuLziuxvSaAaJW+/lvLlX1xHjujri99f3h+8vpfkgL6v 2hhGNdBAeHN4U929fUzTtbQj/dvHjEi6a3yHyW1bBIBlkuCtKes7bwy7le68RCWHAljv zoGaqtTS5lN05RsvG9DDxqCQ10bdsJu4gfuzdjWS/u/EoOmdnd8wU+odFz4t+I4ZGUb3 BE6A== X-Gm-Message-State: APjAAAVfDY3ymO1t9I6+XpmUWTvoghP0yWfg5DZXw96HYJtNoxA1AHlk K4+FnvBRAAutGmro9z0+U1o= X-Google-Smtp-Source: APXvYqxj7SARtIhxgn4jL8AV/yPQgnm4xwcfdQMshoUV87FTJnoSXT0PDmrbNkIJCSVdbL5T3TQWhg== X-Received: by 2002:a1c:5f86:: with SMTP id t128mr9075252wmb.87.1552052227038; Fri, 08 Mar 2019 05:37:07 -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.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:06 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 10/46] tools/lib/traceevent: Man page for tep_is_latency_format() and tep_set_latency_format() Date: Fri, 8 Mar 2019 15:36:18 +0200 Message-Id: <20190308133654.21264-11-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_is_latency_format() and tep_set_latency_format() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-latency_format.txt | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-latency_format.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-latency_format.txt b/tools/lib/traceevent/Documentation/libtraceevent-latency_format.txt new file mode 100644 index 000000000000..ea82cbda7b7c --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-latency_format.txt @@ -0,0 +1,140 @@ +libtraceevent(3) +================ + +NAME +---- +tep_set_latency_format,tep_is_latency_format - Get / set "latency output" format. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +void *tep_set_latency_format*(struct tep_handle pass:[*]_tep_, int _lat_); +int *tep_is_latency_format*(struct tep_handle pass:[*]_tep_); + +-- + +DESCRIPTION +----------- +"Latency output" format prints information about interrupts being disabled, +soft irq being disabled, the "need_resched" flag being set and preempt count. +This information is recorded with every event, but by default is not printed. + +The _tep_set_latency_format()_ function enables the "latency output" printing. +The _tep_ argument is trace event parser context. The _lat_ argument can be zero, +for "latency output" disabled, or non zero for "latency output" enabled. +Information is displayed with 6 characters. When a field is zero, or N/A, a pass:['.'] +is printed. Example: +[verse] +-- + -0 0d.h1. 106467.859747: function: ktime_get <-- tick_check_idle +-- +The 0d.h1. denotes this information. The first character is never a pass:['.'] +and represents what CPU the trace was recorded on (CPU 0). The pass:['d'] denotes +that interrupts were disabled. The pass:['h'] means that this was called inside +an interrupt handler. The pass:['1'] is the preemption disabled (preempt_count) +was set to one. The two pass:['.']s are "need_resched" flag and kernel lock +counter. If the "need_resched" flag is set, then that character would be a pass:['N']. +See 'LATENCY FORMAT' section. + +The _tep_is_latency_format()_ function returns if "latency output" is enabled. + +This "Latency output" setting affects output of _tep_print_event_task()_ +and _tep_print_event_time()_ APIs. + +LATENCY FORMAT +-------------- +The latency format displays 5 or more fields: +[verse] +-- + CPU #, interrupt state, scheduling state, current context, and preemption count. + + Field 1 is the CPU number (starting with zero). + + Field 2 is the interrupt enabled state: + d : Interrupts are disabled + . : Interrupts are enabled + X : The architecture does not support this information + + Field 3 is the "need resched" state. + N : The task is set to call the scheduler when possible, as another + higher priority task may need to be scheduled in. + . : The task is not set to call the scheduler. + + Field 4 is the context state. + . : Normal context + s : Soft interrupt context + h : Hard interrupt context + H : Hard interrupt context which triggered during soft interrupt context. + z : NMI context + Z : NMI context which triggered during hard interrupt context + + Field 5 is the preemption count. + . : The preempt count is zero. + + On preemptible kernels (where the task can be scheduled out in + arbitrary locations while in kernel context), The preempt count, + when non zero, will prevent the kernel from scheduling out the + current task. The preempt count number is displayed when it is not + zero. +-- +Depending on the kernel, it may show other fields (lock depth, +or migration disabled, which are unique to specialized kernels). + +RETURN VALUE +------------ + +The _tep_is_latency_format()_ function returns non zero if "latency output" +is enabled, or zero if it is disabled. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + tep_set_latency_format(tep, 1); +... + if (tep_is_latency_format(tep)) { + /* latency output format is enabled */ + } else { + /* latency output format is disabled */ + } +-- + +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)_, tep_print_event_task(3), tep_print_event_time(3) + +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 From patchwork Fri Mar 8 13:36:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844775 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 0DDC31390 for ; Fri, 8 Mar 2019 13:37:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EED2B2E435 for ; Fri, 8 Mar 2019 13:37:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E346F2E466; Fri, 8 Mar 2019 13:37:10 +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 8184D2E435 for ; Fri, 8 Mar 2019 13:37:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726676AbfCHNhK (ORCPT ); Fri, 8 Mar 2019 08:37:10 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35457 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfCHNhK (ORCPT ); Fri, 8 Mar 2019 08:37:10 -0500 Received: by mail-wm1-f65.google.com with SMTP id y15so12489355wma.0 for ; Fri, 08 Mar 2019 05:37:08 -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=dZKEN8D78d3miwdOGcgg5ljNlQPfFAEZrEh6coCZn6k=; b=K0UqIdHIniDLaD0sSrIcSgRrbNPp9w0aKizOU2UE2peyqhBcdTsnTFv0e0xlvF4hdX DOt5MAO2Gu4OSmyCMeJ5cQkjmcGkW87vUVXDA6qMM0oxnzSNcPCcKnfrw/46x8ZypBoz 0Yj/Pp2bF9u1jCReoUPv9Gjpbs31P0wntiFfltWdHTqU2UM0M5FLJ4eb394gAUBdeSwU 7x/V+DEX9CPruu382J/YtoJzVpCuTJZz+ynxi6ucIcpWu1mzUc6mR5/XHHAh8QtqMTsw VWDXbuLmjImgxOGajJmnTNMd8+3fgsQ2M2prrYJh0Ix59lCgRPoX1njmXDYBucUhCbCB yiEw== X-Gm-Message-State: APjAAAXe12nYjG0yQjxULJMDd4DCOZrTfA4t8KSwIxRTfGWPIT0TbAmD E5Rs2IlZx2KKPfiSxw8sgrq/ims8 X-Google-Smtp-Source: APXvYqzxN63gAcqkkDwaA6Y5tSNXyfKAd34DpmE7pmT7F06TkhAN7YGvLycqoj6Sgr1PNFg9d+ssVg== X-Received: by 2002:a7b:c41a:: with SMTP id k26mr9752834wmi.6.1552052227966; Fri, 08 Mar 2019 05:37:07 -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.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:07 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 11/46] tools/lib/traceevent: Man page for tep_get_page_size() and tep_set_page_size() Date: Fri, 8 Mar 2019 15:36:19 +0200 Message-Id: <20190308133654.21264-12-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_get_page_size() and tep_set_page_size() as part of the libtraceevent APIs. It also alignes description of the functions (in the C code) with the man pages. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-page_size.txt | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-page_size.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-page_size.txt b/tools/lib/traceevent/Documentation/libtraceevent-page_size.txt new file mode 100644 index 000000000000..0701001fffcf --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-page_size.txt @@ -0,0 +1,80 @@ +libtraceevent(3) +================ + +NAME +---- +tep_get_page_size,tep_set_page_size - Get / set the size of a memory page on the +machine, where the trace is generated + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_get_page_size*(struct tep_handle pass:[*]_tep_); +void *tep_set_page_size*(struct tep_handle pass:[*]_tep_, int _page_size_); +-- + +DESCRIPTION +----------- +The _tep_get_page_size()_ function returns the size of a memory page on +the machine, where the trace is generated. The _tep_ argument is trace +event parser context. + +The _tep_set_page_size()_ function stores in the _tep_ context the size of a +memory page on the machine, where the trace is generated. +The _tep_ argument is trace event parser context. +The _page_size_ argument is the size of a memory page, in bytes. + +RETURN VALUE +------------ +The _tep_get_page_size()_ function returns size of the memory page, in bytes. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + int page_size = 4096; + tep_set_page_size(tep, page_size); + if ( 4096 != tep_get_page_size(tep)) { + /* Something wrong happened, page size is not set as expected */ + } +-- + +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 From patchwork Fri Mar 8 13:36:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844777 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 BB73F1390 for ; Fri, 8 Mar 2019 13:37:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6C742E435 for ; Fri, 8 Mar 2019 13:37:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A89E2E466; Fri, 8 Mar 2019 13:37:11 +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 3833D2E435 for ; Fri, 8 Mar 2019 13:37:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726677AbfCHNhL (ORCPT ); Fri, 8 Mar 2019 08:37:11 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:38078 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbfCHNhK (ORCPT ); Fri, 8 Mar 2019 08:37:10 -0500 Received: by mail-wm1-f65.google.com with SMTP id a188so12349537wmf.3 for ; Fri, 08 Mar 2019 05:37:09 -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=kaUtv2HiHbRs71I31pOQlq5+z8JG3v8cy2gTi0jDOvg=; b=tAlD7tP1aeuJCZSvNOnYges12544ps3vlurVFkLJo7fmv0NPblt7ZuL5OrfV1Y7yeE YwCOvWr6VLocFDtSGjATuu7QQxi9XaUmh6dqZWPCdAALnnlps46Vl/mm5DDmjLXnj7WF OLMZtR0lB1KH9rO0XDVM9bkK0bSmbWwsl0k/APIEhQMtRpHGd39h2aPzHKJvfSJ4cR2t hGKZVW4DHFVpGrdXVwps896dUX0QiGHGxZBzuNTsoIlsi5c+aLxXOmWvddwkU71qJLjw WQFCVsyXLw8QV/msNzNLEyuw5Pp6Kh4aftedUPmBiz6kv+CUAQi8QiRE4QFB0M6QIvGq Pq8A== X-Gm-Message-State: APjAAAW8/s/lFph99Qjl3EheFF3pI/WXjv/AWYT2iolRj6kv28kgBNm0 YdnFb0LSizaoOQIBJ5jLv5M= X-Google-Smtp-Source: APXvYqyy0Zr7Fy9jSNInhUoY5VWWiwVb1FirkG0f3ayQV4A95rAvCHOrDM8hfdQn9YWui8Cx5JL8hQ== X-Received: by 2002:a7b:c0d5:: with SMTP id s21mr9954551wmh.153.1552052228961; Fri, 08 Mar 2019 05:37:08 -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.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:08 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 12/46] tools/lib/traceevent: Man page for tep_strerror() Date: Fri, 8 Mar 2019 15:36:20 +0200 Message-Id: <20190308133654.21264-13-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 page for tep_strerror() as part of libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-strerror.txt | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-strerror.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-strerror.txt b/tools/lib/traceevent/Documentation/libtraceevent-strerror.txt new file mode 100644 index 000000000000..b0785a813b57 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-strerror.txt @@ -0,0 +1,78 @@ +libtraceevent(3) +================ + +NAME +---- +tep_strerror - Returns a string describing regular errno and tep error number. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_strerror*(struct tep_handle pass:[*]_tep_, enum tep_errno _errnum_, char pass:[*]_buf_, size_t _buflen_); + +-- +DESCRIPTION +----------- +The _tep_strerror()_ function converts tep error number into a human readable string. +The _tep_ argument is trace event parser context. The _errnum_ is a regular errno, +defined in errno.h, or a tep error number. The string, describing this error number +is copied in the _buf_ argument. The _buflen_ argument is the size of the _buf_. + +RETURN VALUE +------------ +The _tep_strerror()_ function returns 0, if a valid _errnum_ is passed and the +string is copied into _buf_. If _errnum_ is not a valid error number, -1 is returned +and _buf_ is not modified. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +char buf[32]; +char *pool = calloc(1, 128); +if (tep == NULL) { + tep_strerror(tep, TEP_ERRNO__MEM_ALLOC_FAILED, buf, 32); + printf ("The pool is not initialized, %s", buf); +} +... +-- + +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 From patchwork Fri Mar 8 13:36:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844779 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 8B5F017E9 for ; Fri, 8 Mar 2019 13:37:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 772E22E435 for ; Fri, 8 Mar 2019 13:37:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BB0C2E466; Fri, 8 Mar 2019 13:37:12 +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 0B0172E435 for ; Fri, 8 Mar 2019 13:37:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726601AbfCHNhL (ORCPT ); Fri, 8 Mar 2019 08:37:11 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:45907 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfCHNhL (ORCPT ); Fri, 8 Mar 2019 08:37:11 -0500 Received: by mail-wr1-f67.google.com with SMTP id o7so1293213wrp.12 for ; Fri, 08 Mar 2019 05:37:10 -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=2UFED3vSEGamL8v5+qVdneeOvfKII170LlwDa4N6ug4=; b=I0TXwycLaP3jYy+aJUWS3ZKzh1vo9H1uvEbETqZZvHp0PZ4GQm6prfy/OC68Cku51u 6Rma0YpNNdxOTz28q62luVAb4GdVAv08mQGWSOe0MgGwgCrAjYzg1Z6DWnAlSeosEOiS 6pGzKO1FQu8m/ffMi40h0DRrdYNvQxKzyaE28Fzov/OTHSQ2mjR1xii4YOogHvX1d0aW iKZLPrqR0ZjSd1DYMUIAZ1lN8hA299JZw9qni/D/P7/knD8Vw7XXciOfB7WJFYYYJC9r 9lHXyVK9xWUhn/s3r//9srnDTx0Q/rL2KfEFMvm59e1isgPd8/P86fiDj5AmuNi+hM82 9zQQ== X-Gm-Message-State: APjAAAWWtuu9pikE5t+xxPRouZUXb1Sb7UUGkBGFdzrPgs3QgbI/F45z unhAdvfTj3N9UEIJqZQsYuw= X-Google-Smtp-Source: APXvYqwlMqSd6grMn3I7n6CzAI/PkS+PRcxWKQGhgbhyptqdqRQAcmYFLoumGsiLyu2YI8mbMYwnZw== X-Received: by 2002:adf:e98c:: with SMTP id h12mr11508626wrm.302.1552052229835; Fri, 08 Mar 2019 05:37:09 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:09 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 13/46] tools/lib/traceevent: Man page for tep_register_trace_clock() Date: Fri, 8 Mar 2019 15:36:21 +0200 Message-Id: <20190308133654.21264-14-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 page for tep_register_trace_clock() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-reg_clock.txt | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_clock.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-reg_clock.txt b/tools/lib/traceevent/Documentation/libtraceevent-reg_clock.txt new file mode 100644 index 000000000000..8bf6c5348fcf --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-reg_clock.txt @@ -0,0 +1,77 @@ +libtraceevent(3) +================ + +NAME +---- +tep_register_trace_clock - Registers the clock, used for the timestamp of +the events. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_register_trace_clock*(struct tep_handle pass:[*]_tep_, const char pass:[*]_trace_clock_); +-- + +DESCRIPTION +----------- +The _tep_register_trace_clock()_ function registers the clock, used for +the timestamps of the events. When an event is recorded, a timestamp is attached +to it. This timestamp comes from a specified clock. Supported clocks can be seen +in tracefs/trace_clock, the selected one is in square brackets. +The _tep_ argument is the trace event parser context. The _trace_clock_ argument +is the name of the clock, the string is copied internally. + +RETURN VALUE +------------ +The _tep_register_trace_clock()_ function returns 0 in case of success. +If there is not enough memory to copy the _trace_clock_ string -1 is returned +and errno is set to ENOMEM. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + if(tep_register_trace_clock(tep, "local") != 0) { + /* Failed to register the clock */ + } +-- + +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 From patchwork Fri Mar 8 13:36:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844781 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 54F8F17E9 for ; Fri, 8 Mar 2019 13:37:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 404532E40A for ; Fri, 8 Mar 2019 13:37:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34FDE2E466; Fri, 8 Mar 2019 13:37:14 +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 9FBF62E40A for ; Fri, 8 Mar 2019 13:37:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726684AbfCHNhN (ORCPT ); Fri, 8 Mar 2019 08:37:13 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39568 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726679AbfCHNhN (ORCPT ); Fri, 8 Mar 2019 08:37:13 -0500 Received: by mail-wr1-f68.google.com with SMTP id l12so4941071wrp.6 for ; Fri, 08 Mar 2019 05:37:11 -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=qEx2avDLM7gbP4wxYMZBd5eHGGBftNDQRqqfbx8Z/do=; b=oThugCv5DnzcFTeiqlA25UbPHeMBK6A+/qKgJx7W/S62HeWRFecoGD91XSIia80Nrb K7N4T68F/8pLPt/80IHStlksNL92wbFxsF9R/J8iAEM/bLUMdhTSDcCxSVZ3eEHH6Fqy r/bJYxLHYL5PNsCw00g2aTNF9loN+8I0ogrVawhIjT3R/HSsPQhMH7/5K/xmHVykXgMV MtyKXd7fDNoPZa2qs8wvrM7wiKVC/wQTSGX9OvDil1ZuCZJ5sxClnU7wm+4HVs4z7sc8 eXOThpZ1ZtTjI6f8LpliybHvEsV0Uz3qR5GQq8g8cV5FHCYMxIB5dBcFi/k+tSDBhMVm SiAQ== X-Gm-Message-State: APjAAAUdMYVenMI75eyjo/Jqn2eys75qM2bA/cqSgvmsSwl1i/+5F/Ga HEhwgLuaNX2+luyCFnwK0r2AS+oP X-Google-Smtp-Source: APXvYqy3eW8S3ddEm01mHPxjEPTCkKs8dOGhxX8BC7drYjJC2KoCsRwdnpKAgDjJuyKmkEyAJAUh2Q== X-Received: by 2002:a5d:6542:: with SMTP id z2mr10906834wrv.237.1552052230874; Fri, 08 Mar 2019 05:37:10 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:10 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 14/46] tools/lib/traceevent: Man pages for tep_register_event_handler() and tep_unregister_event_handler() Date: Fri, 8 Mar 2019 15:36:22 +0200 Message-Id: <20190308133654.21264-15-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_register_event_handler() and tep_unregister_event_handler() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-reg_event_handler.txt | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt b/tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt new file mode 100644 index 000000000000..bf96dc825e19 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt @@ -0,0 +1,129 @@ +libtraceevent(3) +================ + +NAME +---- +tep_register_event_handler,tep_unregister_event_handler - Register / unregisters +a callback function to parse an event information. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum *tep_reg_handler* { + _TEP_REGISTER_SUCCESS_, + _TEP_REGISTER_SUCCESS_OVERWRITE_, +}; + +int *tep_register_event_handler*(struct tep_handle pass:[*]_tep_, int _id_, const char pass:[*]_sys_name_, const char pass:[*]_event_name_, tep_event_handler_func _func_, void pass:[*]_context_); +int *tep_unregister_event_handler*(struct tep_handle pass:[*]tep, int id, const char pass:[*]sys_name, const char pass:[*]event_name, tep_event_handler_func func, void pass:[*]_context_); + +typedef int (*pass:[*]tep_event_handler_func*)(struct trace_seq pass:[*]s, struct tep_record pass:[*]record, struct tep_event pass:[*]event, void pass:[*]context); +-- + +DESCRIPTION +----------- +The _tep_register_event_handler()_ function registers a handler function, +which is going to be called to parse the information for a given event. +The _tep_ argument is the trace event parser context. The _id_ argument is +the id of the event. The _sys_name_ argument is the name of the system, +the event belongs to. The _event_name_ argument is the name of the event. +If _id_ is >= 0, it is used to find the event, otherwise _sys_name_ and +_event_name_ are used. The _func_ is a pointer to the function, which is going +to be called to parse the event information. The _context_ argument is a pointer +to the context data, which will be passed to the _func_. If a handler function +for the same event is already registered, it will be overridden with the new +one. This mechanism allows a developer to override the parsing of a given event. +If for some reason the default print format is not sufficient, the developer +can register a function for an event to be used to parse the data instead. + +The _tep_unregister_event_handler()_ function unregisters the handler function, +previously registered with _tep_register_event_handler()_. The _tep_ argument +is the trace event parser context. The _id_, _sys_name_, _event_name_, _func_, +and _context_ are the same arguments, as when the callback function _func_ was +registered. + +The _tep_event_handler_func_ is the type of the custom event handler +function. The _s_ argument is the trace sequence, it can be used to create a +custom string, describing the event. A _record_ to get the event from is passed +as input parameter and also the _event_ - the handle to the record's event. The +_context_ is custom context, set when the custom event handler is registered. + +RETURN VALUE +------------ +The _tep_register_event_handler()_ function returns _TEP_REGISTER_SUCCESS_ +if the new handler is registered successfully or _TEP_REGISTER_SUCCESS_OVERWRITE_ if +an existing handler is overwritten. If there is not enough memory to complete +the registration, TEP_ERRNO__MEM_ALLOC_FAILED is returned. + +The _tep_unregister_event_handler()_ function returns 0 if _func_ was removed +successful or, -1 if the event was not found. + +The _tep_event_handler_func_ should return -1 in case of an error, or 0 otherwise. + +EXAMPLE +------- +[source,c] +-- +#include +#include +... +struct tep_handle *tep = tep_alloc(); +... +int custom_event_handler(struct trace_seq *s, struct tep_record *record, + struct tep_event *event, void *context) +{ + trace_seq_printf(s, "kvm_exit event"); + return 0; +} +... + if (tep_register_event_handler(tep, -1, "kvm", "kvm_exit", + custom_event_handler, NULL)) { + /* Failed to register the handler for event "kvm_exit" from "kvm" system */ + } +... + if (tep_unregister_event_handler(pevent, -1, "kvm", "kvm_exit", + custom_event_handler, NULL) != ) { + /* Failed to unregister the handler for event "kvm_exit" from "kvm" system */ + } + +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related APIs. + Trace sequences are used to allow a function to call several other functions + to create a string of data to use. +*-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 From patchwork Fri Mar 8 13:36:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844783 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 96F271390 for ; Fri, 8 Mar 2019 13:37:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 826532E40A for ; Fri, 8 Mar 2019 13:37:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76B1D2E440; Fri, 8 Mar 2019 13:37:14 +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 0C2562E435 for ; Fri, 8 Mar 2019 13:37:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726679AbfCHNhN (ORCPT ); Fri, 8 Mar 2019 08:37:13 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40360 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbfCHNhN (ORCPT ); Fri, 8 Mar 2019 08:37:13 -0500 Received: by mail-wr1-f68.google.com with SMTP id t6so2188128wrw.7 for ; Fri, 08 Mar 2019 05:37:12 -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=/4n/L2s0dTIzxQAtSNlZSWxxEJquqJsNBgrWC2/+lNA=; b=TSa5jnm5lab0VvsqHqgfvS4VHc4r+KIxvgBh/UiELhB4qERhGvb8I8SD9zfWYrluF5 xQgScG2H6tY2kmm2glr4VOtqfVQveB/lPd+Y0HMTIUoCVrSi2Nf7dTi0OI012qKer120 kyVp1QOxPL43v3/VJcZx0XLE9z9dageVvumEWj2EPQFYjkzwgCJEm0oTN/9hyFXIGFIb V1lJ+ZHVo/VGCrcx1tIPmdlQ+jljZACf2HPgepqcG1GfxaSNcnooVOQwVLeEjv/cUNlc LEYenEjq+4zJCtEkUG7Cw/6hUVJj25f0ECerR4Z7IhKlyp68eIo7Ru7xiw7X6I1ITtKM cTeA== X-Gm-Message-State: APjAAAXS+UgrGaq4uuRVLTFVpam48H4bAInwOkLiej6rBuPUfS5fnkXw jc46ogD9mqNBO9FWEZgwaXGTsezq X-Google-Smtp-Source: APXvYqxuwSVEO04QbzX/Y0uz9ApFLOdZqJ06d4ttzAix2qhEjQV9TaLHKe8ITcs8tOeWvQmt2aLeHg== X-Received: by 2002:adf:f40d:: with SMTP id g13mr10947382wro.18.1552052231607; Fri, 08 Mar 2019 05:37:11 -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.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:11 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 15/46] tools/lib/traceevent: Man pages for tep_register_function() and tep_register_print_string() Date: Fri, 8 Mar 2019 15:36:23 +0200 Message-Id: <20190308133654.21264-16-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_register_function() and tep_register_print_string() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-reg_funcstr.txt | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_funcstr.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-reg_funcstr.txt b/tools/lib/traceevent/Documentation/libtraceevent-reg_funcstr.txt new file mode 100644 index 000000000000..fdb9e0352586 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-reg_funcstr.txt @@ -0,0 +1,89 @@ +libtraceevent(3) +================ + +NAME +---- +tep_register_function, tep_register_print_string - Registers a function / string +with a given address. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_register_function*(struct tep_handle pass:[*]_tep_, char pass:[*]_name_, unsigned long long _addr_, char pass:[*]_mod_); +int *tep_register_print_string*(struct tep_handle pass:[*]_tep_, const char pass:[*]_fmt_, unsigned long long _addr_); +-- + +DESCRIPTION +----------- +The _tep_register_function()_ function registers a function name with an +address and module. The _tep_ argument is the trace event parser context. The +_name_ is the name of the function, the string is copied internally. The _addr_ +is the start address of the function. The _mod_ is the kernel module +the function may be in (NULL for none). + +The _tep_register_print_string()_ function registers a string by the address +it was stored in the kernel. The _tep_ argument is the trace event parser +context. The _fmt_ is the string to register, it is copied internally. The _addr_ +is the address the string was located at. + +RETURN VALUE +------------ +The _tep_register_function()_ function returns 0 in case of success. In case of +an error -1 is returned, and errno is set to the appropriate error number. + +The _tep_register_print_string()_ function returns 0 in case of success. In case +of an error -1 is returned, and errno is set to the appropriate error number. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + if (tep_register_function(tep, "my_custom_func", + (unsigned long long) 0x12345678, NULL) != 0) { + /* Failed to register my_custom_func address mapping */ + } +... + if (tep_register_print_string(tep, "print string", + (unsigned long long) 0x87654321, NULL) != 0) { + /* Failed to register "print string" address mapping */ + } +-- +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 From patchwork Fri Mar 8 13:36:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844785 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 1086517E9 for ; Fri, 8 Mar 2019 13:37:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED8722E40A for ; Fri, 8 Mar 2019 13:37:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E21CF2E440; Fri, 8 Mar 2019 13:37:15 +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 6EE7A2E40A for ; Fri, 8 Mar 2019 13:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726706AbfCHNhP (ORCPT ); Fri, 8 Mar 2019 08:37:15 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42272 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfCHNhP (ORCPT ); Fri, 8 Mar 2019 08:37:15 -0500 Received: by mail-wr1-f67.google.com with SMTP id r5so21382004wrg.9 for ; Fri, 08 Mar 2019 05:37:13 -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=a/rHvcNAVSxUe96RX1fH+jJRbSx39a+JiDDGo5Umc3Y=; b=E+l3UzgUYCXKJSQIwp/wgA+kc+XE+iHtMeTnPdOrz0LklX6fffQfljO7AlkuHLmzUt VhPgZWsHT5/eGSaK6ZwVHxHnwcIb0TeO69eSA6KGjAm21qIwMSl34zP9DXKzU8dpT9eF PCOSMpALgUz+3mBe27EiE/F5ytGKw2NGc151Lb54MqRX9JmMDuV4tNPO4Zr/rriXDVaX x4+NA++Ae3QMJJBee9uDwg45vQg6SbCg9MeZbMC3oDbVSpxtxMIH8jb4rbwXaiC9ZvqK YPQBVbSq5/2+5LDoTTn5MFrvKhyHdPn+p3dEP6P+mm3pjJ6ek5AeTAqWOspAm2siG4Ko HN5g== X-Gm-Message-State: APjAAAXXV8Md+ZWm3/Yl86fWWh7S0X+7oeZ8e4ogjQhJq1e/ey1eWxUk Pe9EAKKLDXhPpvyeUnl7O0wD2RTt X-Google-Smtp-Source: APXvYqxHXlS/nPiBV1gXu5M5Vrv6udzQ87IBQsU8DagUSkEDnYqqxkIVrEB/gOyMD7PzNEoAB2TSiw== X-Received: by 2002:adf:9f54:: with SMTP id f20mr11289614wrg.88.1552052232579; Fri, 08 Mar 2019 05:37:12 -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.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:11 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 16/46] tools/lib/traceevent: Man pages for tep_register_print_function() and tep_unregister_print_function() Date: Fri, 8 Mar 2019 15:36:24 +0200 Message-Id: <20190308133654.21264-17-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_register_print_function() and tep_unregister_print_function() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-reg_print_func.txt | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt b/tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt new file mode 100644 index 000000000000..59cef18b71f1 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt @@ -0,0 +1,128 @@ +libtraceevent(3) +================ + +NAME +---- +tep_register_print_function,tep_unregister_print_function - Registers / Unregisters +a helper function. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum *tep_func_arg_type* { + TEP_FUNC_ARG_VOID, + TEP_FUNC_ARG_INT, + TEP_FUNC_ARG_LONG, + TEP_FUNC_ARG_STRING, + TEP_FUNC_ARG_PTR, + TEP_FUNC_ARG_MAX_TYPES +}; + +typedef unsigned long long (*pass:[*]tep_func_handler*)(struct trace_seq pass:[*]s, unsigned long long pass:[*]args); + +int *tep_register_print_function*(struct tep_handle pass:[*]_tep_, tep_func_handler _func_, enum tep_func_arg_type _ret_type_, char pass:[*]_name_, _..._); +int *tep_unregister_print_function*(struct tep_handle pass:[*]_tep_, tep_func_handler _func_, char pass:[*]_name_); +-- + +DESCRIPTION +----------- +Some events may have helper functions in the print format arguments. This allows +a plugin to dynamically create a way to process one of these functions. + +The _tep_register_print_function()_ registers such helper function. The _tep_ +argument is the trace event parser context. The _func_ argument is the address +of the helper function. The _ret_type_ argument is the return type of the +helper function, value from the _tep_func_arg_type_ enum. The _name_ is the name +of the helper function, as seen in the print format arguments. The _..._ is a +variable list of _tep_func_arg_type_ enums, the _func_ function arguments. +This list must end with _TEP_FUNC_ARG_VOID_. + +The _tep_unregister_print_function()_ unregisters a helper function, previously +registered with _tep_register_print_function()_. The _tep_ argument is the +trace event parser context. The _func_ and _name_ arguments are the same, used +when the helper function was registered. + +The _tep_func_handler_ is the type of the helper function. The _s_ argument is +the trace sequence, it can be used to create a custom string. +The _args_ is a list of arguments, defined when the helper function was +registered. + +RETURN VALUE +------------ +The _tep_register_print_function()_ function returns 0 in case of success. +In case of an error, TEP_ERRNO_... code is returned. + +The _tep_unregister_print_function()_ returns 0 in case of success, or -1 in +case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +#include +... +struct tep_handle *tep = tep_alloc(); +... +static long long +process_custom_helper(struct trace_seq *s, unsigned long long *args) +{ + unsigned long long param = args[0]; + trace_seq_printf(s, "the helper was called, with argument %lld", param); + return 0; +} +... + if ( tep_register_print_function(tep, + process_custom_helper, + TEP_FUNC_ARG_STRING, + "custom_helper", + TEP_FUNC_ARG_LONG, + TEP_FUNC_ARG_VOID) != 0) { + /* Failed to register my process_custom_helper function */ + } +... + if (tep_unregister_print_function(tep, process_custom_helper, + "custom_helper") != 0) { + /* Failed to unregister my process_custom_helper function */ + } +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related APIs. + Trace sequences are used to allow a function to call several other functions + to create a string of data to use. +*-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 From patchwork Fri Mar 8 13:36:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844787 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 B43FB17E9 for ; Fri, 8 Mar 2019 13:37:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F7572E40A for ; Fri, 8 Mar 2019 13:37:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93CA12E440; Fri, 8 Mar 2019 13:37:16 +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 30E6E2E40A for ; Fri, 8 Mar 2019 13:37:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726613AbfCHNhQ (ORCPT ); Fri, 8 Mar 2019 08:37:16 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:33399 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbfCHNhP (ORCPT ); Fri, 8 Mar 2019 08:37:15 -0500 Received: by mail-wm1-f67.google.com with SMTP id c13so8984321wmb.0 for ; Fri, 08 Mar 2019 05:37:14 -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=eUjE/wYu/1U5ZRiq54tMRYFe7F7Xz+Ev8qBdR8EHe7w=; b=deViBxmgWxeolBYU9sPFamgVdEgc+xWEPaxIZ0DMVuQViB+xMFbSIsRwPRm4I2JKXh 0W6/U0/lb5FrdsVljniSQK6bOEFvROH0glStokU8N8UdP/1fwjfd6DIkZdV5hZL4KlZ8 jUE13IjlIbVkMv72gP4DbvMhArnf6UNmoU3tioPCOiAn4Hs+RFRsPZKdxk3fyPKB2Gef nY/ZOyMa8buHa54NKSX0hsnHhSZt55m+MtcWe8t3/U/pNFnrWndQJHzLeFr3xmK7BRD4 gByfWnp6p91+CiIEZddrDIdKMGkcd1HR0g/rje3ubnoBGT3TCEWZ2oRcV1jDALEtohwq JNig== X-Gm-Message-State: APjAAAUlJUXolV35NcNLosVgQadY1Gg+rMkCFeaVJeYR/MtlRwOCbHdE wYSyU+wRTQrV5dwLc5ZK5sAzmCTL X-Google-Smtp-Source: APXvYqzGNKCF8uSF5xzlmLxDPt4/TnD0wNwb6uH1akjlT0lALQwC9WX1zxvWqc+uIq9MEd7wPtPvEg== X-Received: by 2002:a05:600c:210b:: with SMTP id u11mr9197988wml.11.1552052233677; Fri, 08 Mar 2019 05:37:13 -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.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:12 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 17/46] tools/lib/traceevent: Man page for tep_read_number() Date: Fri, 8 Mar 2019 15:36:25 +0200 Message-Id: <20190308133654.21264-18-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 page for tep_read_number() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-endian_read.txt | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt b/tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt new file mode 100644 index 000000000000..803819dbf51b --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt @@ -0,0 +1,76 @@ +libtraceevent(3) +================ + +NAME +---- +tep_read_number - Reads a number from raw data. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +unsigned long long *tep_read_number*(struct tep_handle pass:[*]_tep_, const void pass:[*]_ptr_, int _size_); +-- + +DESCRIPTION +----------- +The _tep_read_number()_ function reads an integer from raw data, taking into +account the endianness of the raw data and the current host. The _tep_ argument +is the trace event parser context. The _ptr_ is a pointer to the raw data, where +the integer is, and the _size_ is the size of the integer. + +RETURN VALUE +------------ +The _tep_read_number()_ function returns the integer in the byte order of +the current host. In case of an error, 0 is returned. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +void process_record(struct tep_record *record) +{ + int data = tep_read_number(tep, record->data, 4); + /* Read the first 4 bytes of the record as integer */ +} +... +-- + +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 From patchwork Fri Mar 8 13:36:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844789 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 438901390 for ; Fri, 8 Mar 2019 13:37:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 309CB2E40A for ; Fri, 8 Mar 2019 13:37:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24FBD2E435; Fri, 8 Mar 2019 13:37:17 +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 A65AF2E466 for ; Fri, 8 Mar 2019 13:37:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726709AbfCHNhQ (ORCPT ); Fri, 8 Mar 2019 08:37:16 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34912 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbfCHNhQ (ORCPT ); Fri, 8 Mar 2019 08:37:16 -0500 Received: by mail-wr1-f67.google.com with SMTP id t18so21413240wrx.2 for ; Fri, 08 Mar 2019 05:37:15 -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=TWz/5aF5spJM+gmYokY/ByED7c9k7wibH0kdIAxPq4s=; b=pw6Yn6FlyVj+H0QF12aPzqHVHasYNYZkcGiJNBdy33GjsxS0KS9FMsZhIojGwGZA9t Vd2fFNKO34J7gaGvOIv3alQrSKmZTETv4cX/LCpA97LeQeCOtM4EdXT2ZCN+UX0n60gI x0t0rr46JB4X9r39i/oXRD9rBOzHQb34h/U3ZdNao+dMd+pULi1iZC4WX65xNo/i4/0u I8vlEE0YS84d1IFCN8ntsRsVkhasr0fvpkmnt2REHUw0VBllVZtw87D0VF4io26Ndedi zz22l7uZYh6zMyR0JuBveKE0kNInUmP/Yms5pS08DjWIKl7Ktr6V5CxtODj2UyzVWkbT DW8w== X-Gm-Message-State: APjAAAUlctHf5nzcCF7hW8VwaCpllIdqBnbjV8mfnKiPOCH6NYJm+49M /h3sRWA3yLidNWJG0Iu1VljqjTsw X-Google-Smtp-Source: APXvYqxWYYuKDNSVa6zG0b+vHEmEkLv3e7XMdJ1dgfdZjQWEJ7uDLulpXhIj4QdTNH5K9PtqpRa9qg== X-Received: by 2002:adf:c7c6:: with SMTP id y6mr10820805wrg.217.1552052234558; Fri, 08 Mar 2019 05:37:14 -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.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:13 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 18/46] tools/lib/traceevent: Man pages for tep_find_event(), tep_find_event_by_name() and tep_find_event_by_record() Date: Fri, 8 Mar 2019 15:36:26 +0200 Message-Id: <20190308133654.21264-19-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_event(), tep_find_event_by_name() and tep_find_event_by_record() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-event_find.txt | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_find.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-event_find.txt b/tools/lib/traceevent/Documentation/libtraceevent-event_find.txt new file mode 100644 index 000000000000..961309f24491 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-event_find.txt @@ -0,0 +1,99 @@ +libtraceevent(3) +================ + +NAME +---- +tep_find_event,tep_find_event_by_name,tep_find_event_by_record - Find events by given key. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +struct tep_event pass:[*]*tep_find_event*(struct tep_handle pass:[*]_tep_, int _id_); +struct tep_event pass:[*]*tep_find_event_by_name*(struct tep_handle pass:[*]_tep_, const char pass:[*]_sys_, const char pass:[*]_name_); +struct tep_event pass:[*]*tep_find_event_by_record*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_record_); +-- + +DESCRIPTION +----------- +This set of functions can be used to search for an event, based on a given +criteria. All functions require a pointer to a _tep_, trace event parser context. + +The _tep_find_event()_ function searches for an event by given event _id_. + +The tep_find_event_by_name()_ function searches for an event by given +event _name_, under the system _sys_. If the _sys_ is NULL (not specified), +the first event with _name_ is returned. + +The tep_find_event_by_record()_ function searches for an event from a given +_record_. + +RETURN VALUE +------------ +All these functions return a pointer to the found event, or NULL if there is no +such event. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +struct tep_event *event; + +event = tep_find_event(tep, 1857); +if (event == NULL) { + /* There is no event with ID 1857 */ +} + +event = tep_find_event_by_name(tep, "kvm", "kvm_exit"); +if (event == NULL) { + /* There is no kvm_exit event, from kvm system */ +} + +void event_from_record(struct tep_record *record) +{ + struct tep_event *event = tep_find_event_by_record(tep, record); + if (event == NULL) { + /* There is no event from given record */ + } +} +... +-- + +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 From patchwork Fri Mar 8 13:36:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844791 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 7355617E9 for ; Fri, 8 Mar 2019 13:37:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DC682E40A for ; Fri, 8 Mar 2019 13:37:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 520A62E440; Fri, 8 Mar 2019 13:37:18 +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 E07292E40A for ; Fri, 8 Mar 2019 13:37:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726703AbfCHNhR (ORCPT ); Fri, 8 Mar 2019 08:37:17 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38746 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbfCHNhR (ORCPT ); Fri, 8 Mar 2019 08:37:17 -0500 Received: by mail-wr1-f65.google.com with SMTP id g12so21392424wrm.5 for ; Fri, 08 Mar 2019 05:37:16 -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=tY96rDYVH9xKi+gBJ0gG5dWXJIpRyx68RFvXx3IgsWM=; b=ev5gx6mFH4frkcjn+f/Jd6KdUFJUDhQ7ERm0fIRBtpcA6VQbBaPyO6jvyeOtetR6eN HCwXR2FuE32KdOcWJaEtruSehVIO4aBJMSh5jUxTAQDCua+Z9b9PtXjt36bTOz7gGU7/ zeFfKqc788XFUEATNVJHmqjq1hHcHEo2Un8l+qJjE1/GYHcb/sT9+LIVFLNQw2Jwff62 h8alx82E4PdC6nEGx1LnfSRI++gSec9qbl45zy8nlF6nOTK/nN4TVoK3rfiF6mvAISM4 x1z6/ZEVdJ4GgeTzN6PDfPtYdwh+gWeNNk1/czNIqz74OGgVGUGkkPsLywgUlwaQrt4N mVnQ== X-Gm-Message-State: APjAAAXJoAcbT4OCOkWz+0IN2RTI382IImsdhDcCpxsPYTgO1q++83Ui Dc2Onfl/vEgYB/6iUWzLbkk= X-Google-Smtp-Source: APXvYqy7lOY5msm0aXyTYraI4IEeRaJV4N62Eoydp3ICklphRMLUOKltvAoruxECRLXUQnY5FOKjlw== X-Received: by 2002:adf:8273:: with SMTP id 106mr11487693wrb.34.1552052235499; Fri, 08 Mar 2019 05:37:15 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:14 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 19/46] tools/lib/traceevent: Man page for tep_list_events() Date: Fri, 8 Mar 2019 15:36:27 +0200 Message-Id: <20190308133654.21264-20-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 page for tep_list_events() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-event_list.txt | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_list.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-event_list.txt b/tools/lib/traceevent/Documentation/libtraceevent-event_list.txt new file mode 100644 index 000000000000..97b2e0922900 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-event_list.txt @@ -0,0 +1,94 @@ +libtraceevent(3) +================ + +NAME +---- +tep_list_events - Get list of events, sorted by given criteria. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum *tep_event_sort_type* { + _TEP_EVENT_SORT_ID_, + _TEP_EVENT_SORT_NAME_, + _TEP_EVENT_SORT_SYSTEM_, +}; + +struct tep_event pass:[*]pass:[*]*tep_list_events*(struct tep_handle pass:[*]_tep_, enum tep_event_sort_type _sort_type_); +-- + +DESCRIPTION +----------- +The _tep_list_events()_ function returns an array of pointers to the events, +sorted by the _sort_type_ criteria. The last element of the array is NULL. +The returned memory must not be freed, it is managed by the library. +The _tep_ argument is trace event parser context. The _sort_type_ argument is +the required sort criteria: +[verse] +-- + _TEP_EVENT_SORT_ID_ - sort by the event ID. + _TEP_EVENT_SORT_NAME_ - sort by the event (name, system, id) triplet. + _TEP_EVENT_SORT_SYSTEM_ - sort by the event (system, name, id) triplet. +-- + +RETURN VALUE +------------ +The _tep_list_events()_ function returns an array of pointers to events. +In case of an error, NULL is returned. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +int i=0; +struct tep_event_format **events = tep_list_events(tep, TEP_EVENT_SORT_ID); +if (events == NULL) { + /* Failed to get the events, sorted by ID */ +} else { + while(events[i]) { + /* walk through the list of the events, sorted by the ID */ + i++; + } +} +... +-- + +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 From patchwork Fri Mar 8 13:36:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844793 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 8553317E9 for ; Fri, 8 Mar 2019 13:37:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 724E12E40A for ; Fri, 8 Mar 2019 13:37:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6698C2E466; Fri, 8 Mar 2019 13:37:19 +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 DCAC92E40A for ; Fri, 8 Mar 2019 13:37:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726711AbfCHNhS (ORCPT ); Fri, 8 Mar 2019 08:37:18 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33254 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726591AbfCHNhS (ORCPT ); Fri, 8 Mar 2019 08:37:18 -0500 Received: by mail-wr1-f67.google.com with SMTP id i12so21393817wrw.0 for ; Fri, 08 Mar 2019 05:37:17 -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=0vzoqlTsTIa8+mip/6sLndjy8lAI53sdv6Odos24xi0=; b=Oysj2h9hKzkLeHnpzC3lOWk0VLfM1tE4BD3CqYYtIO8Q0S3dibXMMyPxxvtoPm6PgG +0YMu0rObMLem4S2iPAq6Nyj1OvxA70BTzfuRIxTZ1gZj4P6kbq2He04Lf1mTaGJyfZi JLu8uuZu8PJYFAEzz2TmEAjuIHubo+z4QE6kOJDtCgwSsF96NZGWd2++kqV16uUBDBbA Kbr+tDYGZCFkItypcWHHZDoPxdDuhNbRuyZWys3y4P389IVYKv+v3UNkx8IP7c9q72LS iZkJxDAtLpPezzFuwLmEKppw9h01yg+8RE09UyFm45ITItZjFmIh6E8YWLZD5RGuYojC 0yww== X-Gm-Message-State: APjAAAUN6L96azmT+XIMXrCpJSSa4cXe3W4j1CkLiGHEctb7n2ed0CaO DrRrQeWTSvPsuObKK+h3P93a0U9y X-Google-Smtp-Source: APXvYqy34jo30W8lpZcz8R9r3ttSse1NUt0L2EY85n4H/kVhQF47+UeRV+eggxgy64+G7Wl/WaLygQ== X-Received: by 2002:adf:fdc3:: with SMTP id i3mr10434002wrs.252.1552052236423; Fri, 08 Mar 2019 05:37:16 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:15 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 20/46] tools/lib/traceevent: Man pages for tep_print_event(), tep_print_event_data(), tep_event_info(), tep_print_event_task() and tep_print_event_time() Date: Fri, 8 Mar 2019 15:36:28 +0200 Message-Id: <20190308133654.21264-21-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_print_event(), tep_print_event_data(), tep_event_info(), tep_print_event_task() and tep_print_event_time() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-event_print.txt | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_print.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-event_print.txt b/tools/lib/traceevent/Documentation/libtraceevent-event_print.txt new file mode 100644 index 000000000000..8fea72705645 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-event_print.txt @@ -0,0 +1,126 @@ +libtraceevent(3) +================ + +NAME +---- +tep_print_event,tep_print_event_data,tep_event_info,tep_print_event_task,tep_print_event_time - Parses the data into the print format. + +SYNOPSIS +-------- +[verse] +-- +*#include * +*#include * + +void *tep_print_event_time*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]record, bool _use_trace_clock_); +void *tep_print_event_task*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_); +void *tep_event_info*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_); +void *tep_print_event_data*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_); +void *tep_print_event*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_record pass:[*]_record_, bool _use_trace_clock_); +-- + +DESCRIPTION +----------- +The _tep_print_event_time()_ function prints the timestamp of the _record_ using +the given _event_ information as trace sequence in _s_. The _tep_ argument is +trace event parser context. The _use_trace_clock_ argument indicates if +the tep->trace_clock should be used for parsing the timestamp. + +The _tep_print_event_task()_ function prints the task command, pid and CPU of +the _record_ using the given _event_ information as trace sequence in _s_. +The _tep_ argument is trace event parser context. + +The _tep_event_info()_ function parses the raw data from the _record_ using +the given _event_ information and writes the print format as trace sequence in +_s_. + +The _tep_print_event_data()_ function writes the _event_ name as trace +sequence in _s_ and calls _tep_event_info()_ to parse and write the raw data +from the _record_. The _tep_ argument is trace event parser context. + +The _tep_print_event()_ function prints the _record_ information as trace +sequence in _s_. It finds the corresponding event and calls +_tep_print_event_task()_,_tep_print_event_time()_ and _tep_print_event_data()_ +to parse and print the information. +The _tep_ argument is trace event parser context. The _use_trace_clock_ +argument indicates if the tep->trace_clock should be used for parsing +the timestamp. + +EXAMPLE +------- +[source,c] +-- +#include +#include +... +struct trace_seq seq; +trace_seq_init(&seq); +struct tep_handle *tep = tep_alloc(); +... +void print_my_event(struct tep_record *record) +{ + struct tep_event *event; + + /* print all event information */ + trace_seq_reset(&seq); + tep_print_event(tep, &seq, record, TRUE); + + event = tep_find_event_by_record(tep, record); + + if (event != NULL) { + /* print event timestamp */ + trace_seq_reset(&seq); + tep_print_event_time(tep, &seq, event, record, TRUE); + + /* print event task information */ + trace_seq_reset(&seq); + tep_print_event_task(tep, &seq, event, record); + + /* print event name and raw data */ + trace_seq_reset(&seq); + tep_print_event_data(tep, &seq, event, record); + + /* print event raw data */ + trace_seq_reset(&seq); + tep_event_info(&seq, event, record); + } +} +... +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related APIs. + Trace sequences are used to allow a function to call several other functions + to create a string of data to use. +*-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 From patchwork Fri Mar 8 13:36:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844795 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 01B271390 for ; Fri, 8 Mar 2019 13:37:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E15C72E40A for ; Fri, 8 Mar 2019 13:37:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D57FF2E435; Fri, 8 Mar 2019 13:37:19 +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 580692E440 for ; Fri, 8 Mar 2019 13:37:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726714AbfCHNhT (ORCPT ); Fri, 8 Mar 2019 08:37:19 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53930 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbfCHNhT (ORCPT ); Fri, 8 Mar 2019 08:37:19 -0500 Received: by mail-wm1-f67.google.com with SMTP id e74so12566863wmg.3 for ; Fri, 08 Mar 2019 05:37:17 -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=s+Xi4RNnn4n3FGDyajZ40+ZAG9VqVOURtnngeQmvobM=; b=aFnpsvbPf/xGVHpb9TBVuE84hmDYFJe7+/gpLELg95ABruhd1BFpJvOb+37QOlkHkY q2IAa2tC6HvCGtK7OWLJi9pX+RgKjUf6GtUGPBOOKUQJo1MWTzSfAcnHPyS49ViYJ7o/ JTO21NT7GyxCirj4tA1EezESmP+xcfrL4CAx4KanJb2xGPTONowT4YDjQycIp/zmB9D1 oWmvei4x5f9p9ZAXBsrgStXQDRpZdtTQK0bIVAjv4akmw8GlG5N4mANrxaWGr5NeqOuw FwR8yLLxBSl822dvvVWd/NlkPLYfBRz0FNSS16gzPG28C+lKNmOU6HAV6n5tI3jtCss2 5GJQ== X-Gm-Message-State: APjAAAXtRfquT0ulJfxO3DDGgDL/wmrQazfaDB3XW7k1l5V9507iwQ+v 3hMo4UR7bx0r0Ews52uUIQc= X-Google-Smtp-Source: APXvYqzST5shBOimTOnN1p22MKCR2rFK7RlzDbEQN1qEQ6h28p6moWYIZd/5nI3b7EPatSa02TUxvg== X-Received: by 2002:a1c:2082:: with SMTP id g124mr8815409wmg.59.1552052237281; Fri, 08 Mar 2019 05:37:17 -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.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:16 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 21/46] tools/lib/traceevent: Man pages tep_get_first_event() and tep_get_events_count() Date: Fri, 8 Mar 2019 15:36:29 +0200 Message-Id: <20190308133654.21264-22-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_get_first_event() and tep_get_events_count() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-events.txt | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-events.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-events.txt b/tools/lib/traceevent/Documentation/libtraceevent-events.txt new file mode 100644 index 000000000000..b8f81bb9ece9 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-events.txt @@ -0,0 +1,87 @@ +libtraceevent(3) +================ + +NAME +---- +tep_get_first_event,tep_get_events_count - Access events. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +struct tep_event pass:[*]*tep_get_first_event*(struct tep_handle pass:[*]_tep_); +int *tep_get_events_count*(struct tep_handle pass:[*]_tep_); +-- + +DESCRIPTION +----------- +The _tep_get_first_event()_ function returns a pointer to the first event. +As events are stored in an array, this function returns the pointer to the +beginning of the array. The _tep_ argument is trace event parser context. + +The _tep_get_events_count()_ function returns the number of the events +in the array. The _tep_ argument is trace event parser context. + +RETURN VALUE +------------ +The _tep_get_first_event()_ returns a pointer to the first event. NULL is +returned in case of error, or in case there are no events. + +The _tep_get_events_count()_ returns the number of the events. 0 is +returned in case of error, or in case there are no events. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +int i,count = tep_get_events_count(tep); +struct tep_event *event, *events = tep_get_first_event(tep); + +if (events == NULL) { + /* There are no events */ +} else { + for (i=0; i, 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 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 From patchwork Fri Mar 8 13:36:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844799 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 A067417E9 for ; Fri, 8 Mar 2019 13:37:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D5CC2E40A for ; Fri, 8 Mar 2019 13:37:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81F892E440; Fri, 8 Mar 2019 13:37:22 +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 03AB32E40A for ; Fri, 8 Mar 2019 13:37:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726721AbfCHNhV (ORCPT ); Fri, 8 Mar 2019 08:37:21 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:33258 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbfCHNhV (ORCPT ); Fri, 8 Mar 2019 08:37:21 -0500 Received: by mail-wr1-f66.google.com with SMTP id i12so21393973wrw.0 for ; Fri, 08 Mar 2019 05:37:19 -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=2WcUNq91Sa+L9JNqxAv6wVI1ERPpxmfxrgVkMMg/soc=; b=hc322iya/nToF8gwoJS9ajIQwsZJI1OuUiGsEdeDjN7esOKYxNvIZgDCqHhqzjnLgO supJDwKGtVnjLj54FZykS0BQP2NUKFxBGG+eQlde/MTxEgijFIfn8uOx/7UVBHmyVp1H wI31szS8CPHM0yCaP4Jgoenz+OUQMeufnW1cnXRGohvsrkOnsxvlWshqztTc2eGvw/c9 MToIBKexLtdRHO0l2m9YNH+a6uSYwTFrAIcprF40xz3JGfp6qNUsDMEvBz0qLAk/y6J8 z8QNbDZ+zMV4JUm37QK4EmWUyGkjQATxYl8ZVclbMc7UHAjEu9mpmHiChtmaFcP368Cj f4vw== X-Gm-Message-State: APjAAAVxYVSOtMO1s+bfC8e7AvuIdiWLYchlEOzpm5LGoeP7IIHaF1mN kXtNn9YMWBGUxfuuc+KLOfE= X-Google-Smtp-Source: APXvYqx3xGg4fwPVZPndJ3IDaTio9ntxbx+A4he4TYytk4hlkFnalrQx1c/iBdbdt3zIa0KXaa6Ntw== X-Received: by 2002:a5d:6b8f:: with SMTP id n15mr11226205wrx.110.1552052239106; Fri, 08 Mar 2019 05:37:19 -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.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:18 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 23/46] tools/lib/traceevent: Man pages tep_get_any_field_val(), tep_get_common_field_val(), tep_get_field_val() and tep_get_field_raw() Date: Fri, 8 Mar 2019 15:36:31 +0200 Message-Id: <20190308133654.21264-24-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_get_any_field_val(), tep_get_common_field_val(), tep_get_field_val() and tep_get_field_raw() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-field_get_val.txt | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt b/tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt new file mode 100644 index 000000000000..dbb4875c49fb --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt @@ -0,0 +1,117 @@ +libtraceevent(3) +================ + +NAME +---- +tep_get_any_field_val,tep_get_common_field_val,tep_get_field_val,tep_get_field_raw - Get value of a field. + +SYNOPSIS +-------- +[verse] +-- +*#include * +*#include * + +int *tep_get_any_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_); +int *tep_get_common_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_); +int *tep_get_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_); +void pass:[*]*tep_get_field_raw*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int pass:[*]_len_, int _err_); +-- + +DESCRIPTION +----------- +These functions can be used to find a field and retrieve its value. + +The _tep_get_any_field_val()_ function searches in the _record_ for a filed with +_name_, part of the _event_. If the field is found, its value is stored in _val_. +In case of an error, an error string is printed into _s_, if _err_ is not 0. + +The _tep_get_common_field_val()_ function does the same as +_tep_get_any_field_val()_, but searches only in the common fields. + +The _tep_get_field_val()_ function does the same as +_tep_get_any_field_val()_, but searches only in the event specific fields. + +The _tep_get_field_raw()_ function searches in the _record_ for a filed with _name_, +part of the _event_. If the field is found, a pointer to its raw data is returned. +The size of the data is stored in _len_. In case of an error, an error string +is printed into _s_, if _err_ is not 0. + +RETURN VALUE +------------ +The _tep_get_any_field_val()_, _tep_get_common_field_val()_ and +_tep_get_field_val()_ functions return 0 on success, or -1 in case of an error. + +The _tep_get_field_raw()_ function returns a pointer to field's raw data, and +places the length of this data in _len_. In case of an error NULL is returned. + +EXAMPLE +------- +[source,c] +-- +#include +#include +... +struct tep_handle *tep = tep_alloc(); +... +struct tep_event *event = tep_find_event_by_name(tep, "kvm", "kvm_exit"); +... +void process_record(struct tep_record *record) +{ + int len; + char *comm; + struct tep_event_format *event; + unsigned long long val; + + event = tep_find_event_by_record(pevent, record); + if (event != NULL) { + if (tep_get_common_field_val(NULL, event, "common_type", record, &val, 0) == 0) { + /* Got the value of common type field */ + } + if (tep_get_field_val(NULL, event, "pid", record, &val, 0) == 0) { + /* Got the value of pid specific field */ + } + comm = tep_get_field_raw(NULL, event, "comm", record, &len, 0); + if (comm != NULL) { + /* Got a pointer to the comm event specific field */ + } + } +} +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related APIs. + Trace sequences are used to allow a function to call several other functions + to create a string of data to use. +*-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 From patchwork Fri Mar 8 13:36:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844801 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 5423B17E9 for ; Fri, 8 Mar 2019 13:37:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41B1A2E40A for ; Fri, 8 Mar 2019 13:37:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 363272E466; Fri, 8 Mar 2019 13:37:23 +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 A93542E40A for ; Fri, 8 Mar 2019 13:37:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726680AbfCHNhW (ORCPT ); Fri, 8 Mar 2019 08:37:22 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45920 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726591AbfCHNhW (ORCPT ); Fri, 8 Mar 2019 08:37:22 -0500 Received: by mail-wr1-f65.google.com with SMTP id o7so1293740wrp.12 for ; Fri, 08 Mar 2019 05:37:20 -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=oOcpYcflZAIb5UB/e+VQz657EHCEPwNqKSR/OeW2oDE=; b=XUxH+DkKUDgqHc5QHnLobw1Frfsa7WuL78eLvnoSSKecpcxL53ff0eK2x/5YHF7c7H JW+jXDtlz7pcbsWo5ro1ZsYihRwM3f3N6HmoguHHA1kwFSCba6WU4GRTZuhiQQ1JTS9K HcKsy5FKNWJdTpoZLdq1DKS3R4Vu2pPQVUv/ZEj1XbvquS1RnnbwziNO9Of2VHoJ++jY AqCHTcDjehV+yYCWCbtmcRo+B0XKP4ZUDn9JmNsc4LQ9gYtkBW94ZRwYJnQeq0HJ87Lt ZzIYpUgi+MNn/bbOHyMKIKqrDvFEkljMobZzTcnErvLhJosi+IMXsymslv1RUzKcFtmw PByg== X-Gm-Message-State: APjAAAXU0+AVwkTKfyMVwi9hNRWCB8GSU9ljzLaExLI0h5wddiKxJUjC KMkRsuOVcKe0WNjKSpQ4/dw= X-Google-Smtp-Source: APXvYqw0HlycyCsH/46U5MiWsSCJtfZskGFypfCPL/vX94oAPqkStlqjXhDY9r28tvda9eSvNTp3Yw== X-Received: by 2002:adf:f4d2:: with SMTP id h18mr1498252wrp.241.1552052240014; Fri, 08 Mar 2019 05:37:20 -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.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:19 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 24/46] tools/lib/traceevent: Man pages for tep_print_field(), tep_print_fields(), tep_print_num_field() and tep_print_func_field() Date: Fri, 8 Mar 2019 15:36:32 +0200 Message-Id: <20190308133654.21264-25-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_print_field(), tep_print_fields(), tep_print_num_field() and tep_print_func_field() as part of the libtraceevent APIs. Updated description of functions in event-parse.c Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-field_print.txt | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_print.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-field_print.txt b/tools/lib/traceevent/Documentation/libtraceevent-field_print.txt new file mode 100644 index 000000000000..b6dd524302f3 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-field_print.txt @@ -0,0 +1,120 @@ +libtraceevent(3) +================ + +NAME +---- +tep_print_field,tep_print_fields,tep_print_num_field,tep_print_func_field - Print the field content. + +SYNOPSIS +-------- +[verse] +-- +*#include * +*#include * + +void *tep_print_field*(struct trace_seq pass:[*]_s_, void pass:[*]_data_, struct tep_format_field pass:[*]_field_); +void *tep_print_fields*(struct trace_seq pass:[*]_s_, void pass:[*]_data_, int _size_, struct tep_event pass:[*]_event_); +int *tep_print_num_field*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int _err_); +int *tep_print_func_field*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int _err_); +-- + +DESCRIPTION +----------- +These functions print recorded field's data, according to the field's type. + +The _tep_print_field()_ function extracts from the recorded raw _data_ value of +the _field_ and prints it into _s_, according to the field type. + +The _tep_print_fields()_ prints recorded values of all _event_'s fields. It +iterates all fileds of the _event_, and calls _tep_print_field()_ for each of +them. + +The _tep_print_num_field()_ function prints a numeric field with given format +string. A search is performed in the _event_ for a field with _name_. If such +field is found, its value is extracted from the _record_ and is printed in the +_s_, according to the given format string _fmt_. If the argument _err_ is non-zero, +and an error occures - it is printed in the _s_. + +The _tep_print_func_field()_ function prints a function field with given format +string. A search is performed in the _event_ for a field with _name_. If such +field is found, its value is extracted from the _record_. The value is assumed +to be a function address, and a search is perform to find the name of this +function. The function name (if found) and its address are printed in the _s_, +according to the given format string _fmt_. If the argument _err_ is non-zero, +and an error occures - it is printed in _s_. + +RETURN VALUE +------------ +The _tep_print_num_field()_ and _tep_print_func_field()_ functions return 1 +on success, -1 in case of an error or 0 if the print buffer _s_ is full. + +EXAMPLE +------- +[source,c] +-- +#include +#include +... +struct tep_handle *tep = tep_alloc(); +... +struct trace_seq seq; +trace_seq_init(&seq); +struct tep_event *event = tep_find_event_by_name(tep, "timer", "hrtimer_start"); +... +void process_record(struct tep_record *record) +{ + struct tep_format_field *field_pid = tep_find_common_field(event, "common_pid"); + + trace_seq_reset(&seq); + + /* Print the value of "common_pid" */ + tep_print_field(&seq, record->data, field_pid); + + /* Print all fields of the "hrtimer_start" event */ + tep_print_fields(&seq, record->data, record->size, event); + + /* Print the value of "expires" field with custom format string */ + tep_print_num_field(&seq, " timer expires in %llu ", event, "expires", record, 0); + + /* Print the address and the name of "function" field with custom format string */ + tep_print_func_field(&seq, " timer function is %s ", event, "function", record, 0); + } + ... +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related APIs. + Trace sequences are used to allow a function to call several other functions + to create a string of data to use. +*-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 From patchwork Fri Mar 8 13:36:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844803 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 9F8391390 for ; Fri, 8 Mar 2019 13:37:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CACE2E40A for ; Fri, 8 Mar 2019 13:37:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 814822E435; Fri, 8 Mar 2019 13:37:23 +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 20B462E440 for ; Fri, 8 Mar 2019 13:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726591AbfCHNhW (ORCPT ); Fri, 8 Mar 2019 08:37:22 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:39585 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbfCHNhW (ORCPT ); Fri, 8 Mar 2019 08:37:22 -0500 Received: by mail-wr1-f65.google.com with SMTP id l12so4941648wrp.6 for ; Fri, 08 Mar 2019 05:37:21 -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=m7Hn7G59mHLmCr/lcwZOu3afUTjfbTYKOGnNqVA3Z+8=; b=U6HNGEeP81pTXfpZL7uvVWVsSTstzdSQt/7hbYpxqQICAlmCxVTQHXFr1LXXRW/OQz E0vrvCsZLd9t3o0UWQRQ4J5bCwkJ53OpcEKIPiQh7SD0fEvN9tjVdMilD/ReC1fvSxOH STmfZs4/R0Jm0UrZg7GWiCafK2bzKog1ohK3u9FUnfYdteDMJW8+RgNi9GqYq4buPx06 3KrMe3vCVgcyl4I19ScB6xtlS7V3okLlRxf/Xa/ncl9k3PkdfhHBakG9ybpLt0FMUSbC D9SgtKLVkrKBORUohAzH8F0zImAIu/Du3k9BWaojVE/WdZQj3gFqen6iwPMq2Aheyc8c hTJA== X-Gm-Message-State: APjAAAXLvozkR7mBnHt4f3TAHr/oDZrneiwD5ihwtz31+KFPFbGMHDIp 44QyNUTZFe0fEzMltoBa2U1qd82k X-Google-Smtp-Source: APXvYqxGSNUBNGM4TyoCvJYSafy64YnCVcpCRKw5Twv/4G6YR0mByVEeZbMq2CyykcxduovKKXR8TQ== X-Received: by 2002:adf:ee4d:: with SMTP id w13mr11213246wro.16.1552052240902; Fri, 08 Mar 2019 05:37:20 -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.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:20 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 25/46] tools/lib/traceevent: Man page for tep_read_number_field() Date: Fri, 8 Mar 2019 15:36:33 +0200 Message-Id: <20190308133654.21264-26-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 page for tep_read_number_field() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-field_read.txt | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_read.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-field_read.txt b/tools/lib/traceevent/Documentation/libtraceevent-field_read.txt new file mode 100644 index 000000000000..0c560c416ac2 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-field_read.txt @@ -0,0 +1,80 @@ +libtraceevent(3) +================ + +NAME +---- +tep_read_number_field - Reads a number from a raw data. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_read_number_field*(struct tep_format_field pass:[*]_field_, const void pass:[*]_data_, unsigned long long pass:[*]_value_); +-- + +DESCRIPTION +----------- +The _tep_read_number_field()_ function reads the value of the _field_ from the +raw _data_ and stores it in the _value_. The function sets the _value_ according +to the endianness of the raw data and the current machine. + +RETURN VALUE +------------ +The _tep_read_number_field()_ function retunrs 0 in case of success, or -1 in +case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +struct tep_event *event = tep_find_event_by_name(tep, "timer", "hrtimer_start"); +... +void process_record(struct tep_record *record) +{ + unsigned long long pid; + struct tep_format_field *field_pid = tep_find_common_field(event, "common_pid"); + + if (tep_read_number_field(field_pid, record->data, &pid) != 0) { + /* Failed to get "common_pid" value */ + } +} +... +-- +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 From patchwork Fri Mar 8 13:36:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844805 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 2901817E9 for ; Fri, 8 Mar 2019 13:37:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14CAE2E40A for ; Fri, 8 Mar 2019 13:37:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 098762E466; Fri, 8 Mar 2019 13:37:25 +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 DE77E2E40A for ; Fri, 8 Mar 2019 13:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbfCHNhX (ORCPT ); Fri, 8 Mar 2019 08:37:23 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46367 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfCHNhX (ORCPT ); Fri, 8 Mar 2019 08:37:23 -0500 Received: by mail-wr1-f67.google.com with SMTP id i16so21375568wrs.13 for ; Fri, 08 Mar 2019 05:37:22 -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=YVSItG3KX9MP+WKJwfS70GD9v2G4NzYgsER32Iq0nUY=; b=tGaE/1TLAJPc1VsIQ5AmGbe4QsZXkjpKyE9TsHgDHHm7xrZTYobu2H2coz2x64vNGa u4TXuMwXRzxRpAX7Ij34MnqfBTRfqdodnnLm2aDoYsYtkgZjOtWP5+0GB2dKYBBc1sLF 2JlJ3EUOYb+7czh+Plhsn9RcNO/GLcIqO9PVTH3yWSfhSx5mZU7o9bMpwMiz9clFnKUA r8+a9iCBFwBgG2KFdDfv38G5iIexKtNki0NIaucWtkQCNVmB/izyHcx1XzBuVclXcKWT 75XP5fyBDov1y/4sxYBYWoobNdcSSaOfsdhNGOs46DOZRmxA1bp4qjz/HcDxSOSi8pmP UKxg== X-Gm-Message-State: APjAAAV4QjnTe8Q5FoyqQy56qzD4ZOiYwQXViblM68h1N+xbZaVu2mvJ v5MgPkCekTHi5NJ817TqhJQ= X-Google-Smtp-Source: APXvYqzHBYESHzWm02DBaF10+P8gm8ALylCiR6VlDaEXe6nsfbEx27D36P72xUHv/D7Vr3lEEba9XQ== X-Received: by 2002:a5d:5511:: with SMTP id b17mr2783811wrv.277.1552052241803; Fri, 08 Mar 2019 05:37:21 -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.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:21 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 26/46] tools/lib/traceevent: Man pages for tep_event_common_fields() and tep_event_fields() Date: Fri, 8 Mar 2019 15:36:34 +0200 Message-Id: <20190308133654.21264-27-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_event_common_fields() and tep_event_fields() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-fields.txt | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-fields.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-fields.txt b/tools/lib/traceevent/Documentation/libtraceevent-fields.txt new file mode 100644 index 000000000000..e4f344046519 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-fields.txt @@ -0,0 +1,99 @@ +libtraceevent(3) +================ + +NAME +---- +tep_event_common_fields,tep_event_fields - Get a list of fields for an event. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +struct tep_format_field pass:[*]pass:[*]*tep_event_common_fields*(struct tep_event pass:[*]_event_); +struct tep_format_field pass:[*]pass:[*]*tep_event_fields*(struct tep_event pass:[*]_event_); +-- + +DESCRIPTION +----------- +The _tep_event_common_fields()_ function returns an array of pointers to common +fields for the _event_. The array is allocated in the function and must be freed +by free(). The last element of the array is NULL. + +The _tep_event_fields()_ function returns an array of pointers to event specific +fields for the _event_. The array is allocated in the function and must be freed +by free(). The last element of the array is NULL. + +RETURN VALUE +------------ +Both _tep_event_common_fields()_ and _tep_event_fields()_ functions return +an array of pointers to tep_format_field structures in case of success, or +NULL in case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +int i; +struct tep_format_field **fields; +struct tep_event *event = tep_find_event_by_name(tep, "kvm", "kvm_exit"); +if (event != NULL) { + fields = tep_event_common_fields(event); + if (fields != NULL) { + i = 0; + while (fields[i]) { + /* walk through the list of the common fields of the kvm_exit event */ + i++; + } + free(fields); + } + fields = tep_event_fields(event); + if (fields != NULL) { + i = 0; + while (fields[i]) { + /* walk through the list of the event specific fields of the kvm_exit event */ + i++; + } + free(fields); + } +} +... +-- + +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 From patchwork Fri Mar 8 13:36:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844807 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 DDC9B17E9 for ; Fri, 8 Mar 2019 13:37:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9CE72E435 for ; Fri, 8 Mar 2019 13:37:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE79B2E466; Fri, 8 Mar 2019 13:37:25 +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 B0ED32E435 for ; Fri, 8 Mar 2019 13:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726732AbfCHNhY (ORCPT ); Fri, 8 Mar 2019 08:37:24 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43767 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbfCHNhY (ORCPT ); Fri, 8 Mar 2019 08:37:24 -0500 Received: by mail-wr1-f68.google.com with SMTP id d17so21389450wre.10 for ; Fri, 08 Mar 2019 05:37:23 -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=Qrts+UVGs5O0G1MTkOgPGdEdfruWa9Z/47yZoFESDBA=; b=qJOcDxMb2JSWizFWPx64iON6/DLqrOkCWw5bdy8BhBWzEnVAHB+W9UqsNVxC3Cp51s e8LBLr2y6SUBYI/8XJypbES5smnsfkBEcSCWIKb8UgSlOf1w7vwIB6BX5DRZhyvat3JP PZDxTcwp46ulTwEYNDkaVVmXda+uotssV/JP7Mv+tTtqgXrEH0qje/Wzy4xYrTuyEpIg evnvUchycTpagHG7wfwPjcNYq8/4531BitcuEqFeZMexMUcqhJuRthdL56W2Ry++Ovhc jkYaL43CIXyJsHlbpPp8J0XpVNXCVgkcX5OSSrfxTy9I/m99mkGLey/mOayy0arrRW7d 5Sgg== X-Gm-Message-State: APjAAAX+yT/wioyfiNrJvxmHWhBEMHBXuIopq1Uol8Kg2+0D7FJjR21B PK3x4N+rd6N6zy+K1FZCULI= X-Google-Smtp-Source: APXvYqxIwhMQRU60OB0OG7Ca8hRATSRjCLU1kaftkNUr9zNH7jxEVY0Y7supFrTLkPv6tNYGdz9NRA== X-Received: by 2002:adf:e80c:: with SMTP id o12mr10606483wrm.114.1552052242636; Fri, 08 Mar 2019 05:37:22 -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.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:22 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 27/46] tools/lib/traceevent: Man pages for tep_filter_alloc(), tep_filter_free() and tep_filter_reset() Date: Fri, 8 Mar 2019 15:36:35 +0200 Message-Id: <20190308133654.21264-28-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 tep_filter_alloc(), tep_filter_free() and tep_filter_reset() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-filter.txt | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-filter.txt b/tools/lib/traceevent/Documentation/libtraceevent-filter.txt new file mode 100644 index 000000000000..6335bcc10c6c --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-filter.txt @@ -0,0 +1,85 @@ +libtraceevent(3) +================ + +NAME +---- +tep_filter_alloc,tep_filter_free,tep_filter_reset - Create / free / reset an event filter. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +struct tep_event_filter pass:[*]*tep_filter_alloc*(struct tep_handle pass:[*]_tep_); +void *tep_filter_free*(struct tep_event_filter pass:[*]_filter_); +void *tep_filter_reset*(struct tep_event_filter pass:[*]_filter_); +-- + +DESCRIPTION +----------- +The _tep_filter_alloc()_ function creates a new event filter. The _tep_ argument +is the trace event parser context. + +The _tep_filter_free()_ function frees an event filter and all resources that it +had used. + +The _tep_filter_reset()_ function removes all rules from an event filter and +resets it. + +RETURN VALUE +------------ +The _tep_filter_alloc()_ function returns a pointer to the newly created event +filter, or NULL in case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +struct tep_event_filter *filter = tep_filter_alloc(tep); +if (filter == NULL) { + /* Failed to create the filter */ +} +... +tep_filter_reset(filter); +... +tep_filter_free(filter); +... +-- + +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 From patchwork Fri Mar 8 13:36:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844809 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 1ACA91390 for ; Fri, 8 Mar 2019 13:37:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 075E22E40A for ; Fri, 8 Mar 2019 13:37:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F01742E440; Fri, 8 Mar 2019 13:37:25 +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 8EEDF2E40A for ; Fri, 8 Mar 2019 13:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726733AbfCHNhZ (ORCPT ); Fri, 8 Mar 2019 08:37:25 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45929 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfCHNhZ (ORCPT ); Fri, 8 Mar 2019 08:37:25 -0500 Received: by mail-wr1-f68.google.com with SMTP id o7so1293933wrp.12 for ; Fri, 08 Mar 2019 05:37:24 -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=Wh6TRkpAyO1kZo2dHBmbbrZh1XfT6EtR+AMfSgR1Vw8=; b=o7CTx1E9Boqbu35gcKy1RkgHYJJ4bHL5ywIjkx51f8T27XFVWAg81zC9/5lcLb08X/ 5uskZ1c39mA15qkdPXh+Kt7+jOJ8nt9bin55N7Ieh92D9mm2l9pb6lX28RvrMbU1YDDP sOq2fnnahx3bpIjJtwGkqC2oGKzelnVKCUkEztakF+iE3m+EoPSHEYaW1CNBftScRo+o Vxfqa0QTMLIJOo7tmaZ75SWogZWGjf90YBN+TAzM/fU+Egp4XyjnShR0n461kjLk9zN0 eTdfFULJNx1TXY5LW5TjpMMhZ1ay39J2w5rFRdr5FDhcdipnqTKEDjdMKmpzQg8ziJMD NlAw== X-Gm-Message-State: APjAAAWAxRT1YanMAp67oRTXpeugHL2CkzwKOmPWrr7e3ppZiN/r/0Ij hTAM6rt4SH6GshQYGfQsVw6A0pMy X-Google-Smtp-Source: APXvYqxXe+7uUpcXIG+3Kd4HF1Hkwg+i9CAMC556/mmoY29eigA5XyOS+Sz5/iP1zT/HatvA5w72kw== X-Received: by 2002:adf:f40d:: with SMTP id g13mr10948002wro.18.1552052243542; Fri, 08 Mar 2019 05:37:23 -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.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:22 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 28/46] tools/lib/traceevent: Man page for tep_filter_add_filter_str() Date: Fri, 8 Mar 2019 15:36:36 +0200 Message-Id: <20190308133654.21264-29-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 page for tep_filter_add_filter_str() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-filter_add.txt | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter_add.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-filter_add.txt b/tools/lib/traceevent/Documentation/libtraceevent-filter_add.txt new file mode 100644 index 000000000000..5b8f67e406b2 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-filter_add.txt @@ -0,0 +1,78 @@ +libtraceevent(3) +================ + +NAME +---- +tep_filter_add_filter_str - Adds a new rule to a filter. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum tep_errno *tep_filter_add_filter_str*(struct tep_event_filter pass:[*]_filter_, const char pass:[*]_filter_str_); +-- + +DESCRIPTION +----------- +The _tep_filter_add_filter_str()_ function adds a new rule to the _filter_. The +_filter_str_ argument is the filter string, that contains the rule. + +RETURN VALUE +------------ +The _tep_filter_add_filter_str()_ function returns 0 if the rule was +successfully added or a negative error code. Use _tep_filter_strerror()_ to see +actual error message in case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +struct tep_event_filter *filter = tep_filter_alloc(tep); +... +int ret; +char errstr[200]; +ret = tep_filter_add_filter_str(filter, "sched/sched_wakeup:target_cpu==1"); +if(ret < 0) { + tep_filter_strerror(filter, ret, errstr, sizeof(errstr)); + /* Failed to add a new rule to the filter, the error string is in errstr */ +} +... +-- + +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)_, _tep_filter_strerror(3)_ + +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 From patchwork Fri Mar 8 13:36:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844811 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 1331E17E9 for ; Fri, 8 Mar 2019 13:37:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F33532E40A for ; Fri, 8 Mar 2019 13:37:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7B7E2E440; Fri, 8 Mar 2019 13:37:26 +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 8617A2E40A for ; Fri, 8 Mar 2019 13:37:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbfCHNh0 (ORCPT ); Fri, 8 Mar 2019 08:37:26 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44826 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbfCHNh0 (ORCPT ); Fri, 8 Mar 2019 08:37:26 -0500 Received: by mail-wr1-f66.google.com with SMTP id w2so21389336wrt.11 for ; Fri, 08 Mar 2019 05:37:25 -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=K2nyS3OpjbzlgNx4KdcnUbUA5cdjGGXiq/FsyP8aCbE=; b=BWD2BBaiam2g/UbnrXkK7EweGKt2WVmwcRMSnZNTuRc3Bb8MDEAbcQsiSyI3p9Dtjq 61jk5/aoetQkpqH0tNAD6uwDh1upvjW752GsGlIOT+ToUlxpBRRFpU2WsrRvLnahKFsN /7AL/UkJrR0gE8OCfchrtMmggKmp4Fmhlky5CC+cOOSksBwQk7a3U2EHO/CnI4vsId5E jlKLZyJol70gUSAwgniAe2TnAoKpmIObVDKVyiUI+D//EDUq1wzWLbkT4Bep2ljZpy+U 81MyfK+en+9pwOVd5vbslDuu1st1/1EFE1ugSp4gsND10M0228YhJnzpcrWsH5CpDH/F Kcbg== X-Gm-Message-State: APjAAAV57yOCnwjbbZkWgFytuE02/GaFQNtWesHyAAxuw+frwOXVkjJK d7vYZffCxQMsgsb+oShml5RYVmbi X-Google-Smtp-Source: APXvYqxAkl6VY1BCPrW6GCHKnrX/8B4v2ie/eYHe13hdznYtkxa4OrirOkgE3Uryp3TsSZaLKDIpEA== X-Received: by 2002:a05:6000:10cf:: with SMTP id b15mr11280406wrx.32.1552052244489; Fri, 08 Mar 2019 05:37:24 -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.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:24 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 29/46] tools/lib/traceevent: Man page for tep_filter_strerror() Date: Fri, 8 Mar 2019 15:36:37 +0200 Message-Id: <20190308133654.21264-30-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 page for tep_filter_strerror() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-filter_error.txt | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter_error.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-filter_error.txt b/tools/lib/traceevent/Documentation/libtraceevent-filter_error.txt new file mode 100644 index 000000000000..57bd19ad5d53 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-filter_error.txt @@ -0,0 +1,78 @@ +libtraceevent(3) +================ + +NAME +---- +tep_filter_strerror - Fills the filter error message in a buffer. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_filter_strerror*(struct tep_event_filter pass:[*]_filter_, enum tep_errno _err_, char pass:[*]buf, size_t _buflen_); +-- + +DESCRIPTION +----------- +The _tep_filter_strerror()_ function copies the _filter_ error buffer into the +given _buf_ with the size _buflen_. If the error buffer is empty, in the _buf_ +is copied a string, describing the error _err_. + +RETURN VALUE +------------ +The _tep_filter_strerror()_ function returns 0 if message was filled +successfully, or -1 in case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +struct tep_event_filter *filter = tep_filter_alloc(tep); +... +int ret; +char errstr[200]; +ret = tep_filter_add_filter_str(filter, "sched/sched_wakeup:target_cpu==1"); +if(ret < 0) { + tep_filter_strerror(filter, ret, errstr, sizeof(errstr)); + /* Failed to add a new rule to the filter, the error string is in errstr */ +} +... +-- + +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 From patchwork Fri Mar 8 13:36:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844813 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 2160E17E9 for ; Fri, 8 Mar 2019 13:37:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BB902E40A for ; Fri, 8 Mar 2019 13:37:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F408A2E440; Fri, 8 Mar 2019 13:37:27 +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 9155A2E40A for ; Fri, 8 Mar 2019 13:37:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726720AbfCHNh1 (ORCPT ); Fri, 8 Mar 2019 08:37:27 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43768 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfCHNh1 (ORCPT ); Fri, 8 Mar 2019 08:37:27 -0500 Received: by mail-wr1-f65.google.com with SMTP id d17so21389585wre.10 for ; Fri, 08 Mar 2019 05:37:26 -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=V8CBUyIiZxvhAQGN49U1N68+lFZo6BYMAtwLWK1iDjA=; b=EykA4vO3U6cjLrEj/DY0SrqfffTdG9cQghhYi0L95gIEoFsZQ2wigrS9uC75FfvDKy 8cAL6I9Oym8xzdek16BfQNooGieNsm+aVN3VviNqkhvdnk8JVVA6J7BDAZJ1MRxV6Kfu 2/jF0UBNKtuVN+QGQFoCpwyGa5e79GxqvcpuRIcPtWZM6jjgFNuMvmKcGGHL/gz4qo/g bZlkwf+BdidO1ile/CXPShCZs7uVadbhREtby/UAL0RCEeBLE2py+LihAB7XeG/FcjXW Jj0pBLX3GLyYrkM8c8NKqrBpNvUV1h3csxlTDxQB0ZUF0ilGACwG8MY8Nt8EaOfcgkWi KPtg== X-Gm-Message-State: APjAAAWWhL4xfuv84uotW8DNnRHLrDx7s38Hei0sbpriEMT2OwGl930K UTzWr4udZbOO8DeruGWQghSQTMGN X-Google-Smtp-Source: APXvYqwbRcfayFLR0nOQqux3MDUXIGI2daiNG1HnI/jKrp64tHCHGjugeLFoPDKTrZ2pc/4QBQTWEQ== X-Received: by 2002:adf:9f54:: with SMTP id f20mr11290291wrg.88.1552052245437; Fri, 08 Mar 2019 05:37:25 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:25 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 30/46] tools/lib/traceevent: Man pages for tep_event_filtered() and tep_filter_remove_event() Date: Fri, 8 Mar 2019 15:36:38 +0200 Message-Id: <20190308133654.21264-31-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_event_filtered() and tep_filter_remove_event() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-filter_event.txt | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter_event.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-filter_event.txt b/tools/lib/traceevent/Documentation/libtraceevent-filter_event.txt new file mode 100644 index 000000000000..9d73e6ec8511 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-filter_event.txt @@ -0,0 +1,84 @@ +libtraceevent(3) +================ + +NAME +---- +tep_event_filtered,tep_filter_remove_event - Checks / removes a filter on an event. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_event_filtered*(struct tep_event_filter pass:[*]_filter_, int _event_id_); +int *tep_filter_remove_event*(struct tep_event_filter pass:[*]_filter_, int _event_id_); +-- + +DESCRIPTION +----------- +The _tep_event_filtered()_ function checks if the event with _event_id_ has +_filter_. + +The _tep_filter_remove_event()_ function removes a _filter_ for an event with +_event_id_. + +RETURN VALUE +------------ +The _tep_event_filtered()_ function returns 1 if the filter is found for given +event, or 0 otherwise. + +The _tep_filter_remove_event()_ function returns 1 if the vent was removed, or +0 if the event was not found. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +struct tep_event_filter *filter = tep_filter_alloc(tep); +... +if (tep_event_filtered(filter, 1857) == 1) { + /* Event 1857 has filter */ +} + +if (tep_filter_remove_event(filter, 1857) == 1) { + /* Event 1857 was removed from the filter */ +} +... +-- + +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 From patchwork Fri Mar 8 13:36:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844817 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 3F2941803 for ; Fri, 8 Mar 2019 13:37:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ABE12E435 for ; Fri, 8 Mar 2019 13:37:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F3162E40A; Fri, 8 Mar 2019 13:37:29 +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 B1C122E435 for ; Fri, 8 Mar 2019 13:37:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726737AbfCHNh2 (ORCPT ); Fri, 8 Mar 2019 08:37:28 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51441 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726623AbfCHNh2 (ORCPT ); Fri, 8 Mar 2019 08:37:28 -0500 Received: by mail-wm1-f68.google.com with SMTP id n19so12556535wmi.1 for ; Fri, 08 Mar 2019 05:37:27 -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=wnWrGzQARiX1s+dRisL2DZot2ArWd/j/DpLT54yarC4=; b=DEnBxIlyldMo5D1GdkLof9/KvAwXUpoDUsH55KvjX+mrLeyypNYrW/mVbIYlAggnvF KrZKExoVuBb/bVpZxBThqjE1tuaUf+rAtgvNyVa1ugFiFN+gPQs5Yd7WWezrfTiANCK/ F4JV6d7PaIVt34HYT2L4nsKBrdVTGGL56zv8gWjYMOkXqpV1HslCqwBiGJUwTbqt7hbd jZM0YTNQ5XnBf/GEqQqkA0UoSwCBSBJRl99GMDpUlIFuhTODcwuo710ZVDNFqCR5LyLF PrxI/y2JOuURsfHz7UdRp+w/M6O/zqqs+qe9aOj845By+UOcgLTeM2qbDNCiwspa4CL7 cGiw== X-Gm-Message-State: APjAAAVBUP8Cupf+NrHvAlaA+VSJ0ZFctS5mjuLkLl+HogIVxdaAeJAY 95AdMSvsxEezQVE60ESlwEzsL+Wn X-Google-Smtp-Source: APXvYqxfFx7vN/6xrekCOl9f2WF28FNuiVEnyw25uocW/bXEo0Ldulxo1mVEFxiWZFRd2OahjLuMFw== X-Received: by 2002:a1c:6305:: with SMTP id x5mr7657677wmb.144.1552052246443; Fri, 08 Mar 2019 05:37:26 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:25 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 31/46] tools/lib/traceevent: Man page for tep_filter_match() Date: Fri, 8 Mar 2019 15:36:39 +0200 Message-Id: <20190308133654.21264-32-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 page for tep_filter_match() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-filter_match.txt | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter_match.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-filter_match.txt b/tools/lib/traceevent/Documentation/libtraceevent-filter_match.txt new file mode 100644 index 000000000000..af5e6d2a5986 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-filter_match.txt @@ -0,0 +1,96 @@ +libtraceevent(3) +================ + +NAME +---- +tep_filter_match - Tests if a record matches a filter. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum tep_errno *tep_filter_match*(struct tep_event_filter pass:[*]_filter_, struct tep_record pass:[*]_record_); +-- + +DESCRIPTION +----------- +The _tep_filter_match()_ function tests if a _record_ matches given _filter_. + +RETURN VALUE +------------ +The _tep_filter_match()_ function returns _tep_errno_, according to the result: +[verse] +-- +_pass:[TEP_ERRNO__FILTER_MATCH]_ - filter found for event, the record matches. +_pass:[TEP_ERRNO__FILTER_MISS]_ - filter found for event, the record does not match. +_pass:[TEP_ERRNO__FILTER_NOT_FOUND]_ - no filter found for record's event. +_pass:[TEP_ERRNO__NO_FILTER]_ - no rules in the filter. +-- +or any other _tep_errno_, if an error occurred during the test. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +struct tep_event_filter *filter = tep_filter_alloc(tep); +... +void process_record(struct tep_record *record) +{ + switch (tep_filter_match(filter, record)) { + case TEP_ERRNO__FILTER_MATCH: + /* The filter matches the record */ + break; + case TEP_ERRNO__FILTER_MISS: + /* The filter does not match the record */ + break; + case TEP_ERRNO__FILTER_NOT_FOUND: + /* No filter found for record's event */ + break; + case TEP_ERRNO__NO_FILTER: + /* There are no rules in the filter */ + break + default: + /* An error occurred during the test */ + break; + } +} +... +-- + +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 From patchwork Fri Mar 8 13:36:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844819 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 F24E11390 for ; Fri, 8 Mar 2019 13:37:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF2D22E40A for ; Fri, 8 Mar 2019 13:37:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D39372E440; Fri, 8 Mar 2019 13:37:29 +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 6F3EA2E435 for ; Fri, 8 Mar 2019 13:37:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbfCHNh3 (ORCPT ); Fri, 8 Mar 2019 08:37:29 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39005 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfCHNh3 (ORCPT ); Fri, 8 Mar 2019 08:37:29 -0500 Received: by mail-wm1-f65.google.com with SMTP id z84so12439956wmg.4 for ; Fri, 08 Mar 2019 05:37:28 -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=NKi0RPd+/+/jSQfXotQ+wmF/Y6LhamUzgX6OcrfcCRw=; b=GPxbBadlxBon5ahh4plcOm4SWKduFc6vhFtOedF/ABVvSOnQfFHhZdysCcc+9eTZ48 UKqk4sBzmhXBtDs/LeMX4rsnB0OSwh6IRPyk9N4fCY56nP3SZGk9BXTN4U1t0vQHnOKQ eQe2/FF4XEnK4yebf+rgHYqKEU1ax2qzWYj2c+v+QQfNtYwRUZYu1jnAttxHYY8nU7m8 AW0g5DaOlXiWnoveOlrME/Skm+2u1I97EmUgpilgFPTC1Z47RbgUkK5lRf1Q4I4sbV2v 2VZo/TDFRSS7ALEwo5mqwRQ5Ac5ZCWph1uSnWE/To2Os4TpDbQ70OzT2hfxSefhAnnuu ZHLg== X-Gm-Message-State: APjAAAU5okjs21epdT3D6hTXNGVmapEDJpSdn1IIGoNUAzmAXytPoqiI T42d3q4MxOr1gfnjh6eq4ua0a1Am X-Google-Smtp-Source: APXvYqy3A0QSHw3qcCSmbjmmldHtg30pPet2zZ1tz8ve749Se9h/+oIWpseNnUYchlnnqbxb4kNvWQ== X-Received: by 2002:a1c:7e58:: with SMTP id z85mr9438494wmc.52.1552052247385; Fri, 08 Mar 2019 05:37:27 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:26 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 32/46] tools/lib/traceevent: Man pages for tep_filter_copy() and tep_filter_compare() Date: Fri, 8 Mar 2019 15:36:40 +0200 Message-Id: <20190308133654.21264-33-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_filter_copy() and tep_filter_compare() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-filter_oper.txt | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter_oper.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-filter_oper.txt b/tools/lib/traceevent/Documentation/libtraceevent-filter_oper.txt new file mode 100644 index 000000000000..dce4cc649ad0 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-filter_oper.txt @@ -0,0 +1,84 @@ +libtraceevent(3) +================ + +NAME +---- +tep_filter_copy,tep_filter_compare - Copy / compare operations with event filters. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_filter_copy*(struct tep_event_filter pass:[*]_dest_, struct tep_event_filter pass:[*]_source_); +int *tep_filter_compare*(struct tep_event_filter pass:[*]_filter1_, struct tep_event_filter pass:[*]_filter2_); +-- + +DESCRIPTION +----------- +The _tep_filter_copy()_ function copies a _source_ filter into a _dest_ filter. + +The _tep_filter_compare()_ function compares two filers - _filter1_ and _filter2_. + +RETURN VALUE +------------ +The _tep_filter_copy()_ function returns 0 on success or -1 if not all rules + were copied. + +The _tep_filter_compare()_ function returns 1 if the two filters hold the same +content, or 0 if they do not. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +struct tep_event_filter *filter1 = tep_filter_alloc(tep); +struct tep_event_filter *filter2 = tep_filter_alloc(tep); +... +if (tep_filter_copy(filter1, filter2) != 0) { + /* Failed to copy filter2 in filter1 */ +} +... +if (tep_filter_compare(filter1, filter2) != 1) { + /* Both filters are different */ +} +... +-- + +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 From patchwork Fri Mar 8 13:36:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844821 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 C0FE41390 for ; Fri, 8 Mar 2019 13:37:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD5FE2E40A for ; Fri, 8 Mar 2019 13:37:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1EF82E440; Fri, 8 Mar 2019 13:37:30 +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 42C4F2E40A for ; Fri, 8 Mar 2019 13:37:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726743AbfCHNha (ORCPT ); Fri, 8 Mar 2019 08:37:30 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36566 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726623AbfCHNh3 (ORCPT ); Fri, 8 Mar 2019 08:37:29 -0500 Received: by mail-wr1-f68.google.com with SMTP id o17so21411951wrw.3 for ; Fri, 08 Mar 2019 05:37:28 -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=CKZ0vQumDnE4o2awGyv+reBvTJfL3GSDGfpLWC0Z54U=; b=SIxmcuQcjMr72w5RdwVVrHvOhDoqiHA+USMmtVu7tAWd9XFuQco7ZHqBISeZQjZCfI mVLC71QWMOPwsO7HJTQAmjnxrFW+cQKa4fDhwUFbBXPbPD6HhFnIRLlUYtf/DxYGEcOH YVRloEAvFzXyz9iHOcdxVJ8hTn1gkSUFqebXNw1RAwSBAVxSoMrDRw7xm5/97pJKnJTt xnxaH7QloRkRMEdbBCKQdseBK491sbK9LI2meDrop/V10bY90kufLQt3hp80xrD8Tm1/ bqxtaS1RaeiG16XpkYdlqfJ/+RO0STUJtcnc4rJtL9OT+l8ny/vlVlO1lyKrbfzFWZVz rxig== X-Gm-Message-State: APjAAAXcGT4S2kG7ggvkOtKrNR8Tw4/pLjKxc1RN9Gc0WAwZR/PbyAHz RV1KOGM3XZQqqIZf3HcQCHg= X-Google-Smtp-Source: APXvYqx43rOFgMo2M44K7UcwaTODSzxJWQbnj1TMoOnBVj1UgtGpLlkmYZn3q/qv/h3TF9zX8da2lw== X-Received: by 2002:adf:dfca:: with SMTP id q10mr11264040wrn.45.1552052248309; Fri, 08 Mar 2019 05:37:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:27 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 33/46] tools/lib/traceevent: Man page for tep_filter_make_string() Date: Fri, 8 Mar 2019 15:36:41 +0200 Message-Id: <20190308133654.21264-34-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 page for tep_filter_make_string() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-filter_show.txt | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter_show.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-filter_show.txt b/tools/lib/traceevent/Documentation/libtraceevent-filter_show.txt new file mode 100644 index 000000000000..8d54b401018e --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-filter_show.txt @@ -0,0 +1,75 @@ +libtraceevent(3) +================ + +NAME +---- +tep_filter_make_string - Returns a string showing the filter. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +char pass:[*]*tep_filter_make_string*(struct tep_event_filter pass:[*]_filter_, int _event_id_); +-- + +DESCRIPTION +----------- +The _tep_filter_make_string()_ function constructs a string, displaying +the _filter_ contents for given _event_id_. + +RETURN VALUE +------------ +The _tep_filter_make_string()_ function returns a string, which must be freed +with free(), or NULL in case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +struct tep_event_filter *filter = tep_filter_alloc(tep); +... +char *fstring = tep_filter_make_string(filter, 352); +if (fstring != NULL) { + /* The filter for event 352 is in fstring */ + free(fstring); +} +... +-- + +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 From patchwork Fri Mar 8 13:36:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844823 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 16A0817E9 for ; Fri, 8 Mar 2019 13:37:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 020F12E435 for ; Fri, 8 Mar 2019 13:37:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8E512E466; Fri, 8 Mar 2019 13:37:31 +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 744282E435 for ; Fri, 8 Mar 2019 13:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726747AbfCHNhb (ORCPT ); Fri, 8 Mar 2019 08:37:31 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39007 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfCHNhb (ORCPT ); Fri, 8 Mar 2019 08:37:31 -0500 Received: by mail-wm1-f65.google.com with SMTP id z84so12440031wmg.4 for ; Fri, 08 Mar 2019 05:37:30 -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=Vu6QT8s5Srnk+GrxWrbQBtIyr3fk9VDzF7tIoJo3eI0=; b=mUI4yNVsOBr346L8eZHQk9PhUyrxQ3dHj4LJFBu39wXvYT79eo5/2Pk7LsDFVCuP16 HOxx+a1U2hiJ/GyDmphNkQc9gf1+ZLw8WkddJasPpeBiTBTB+h2BdQHDyPl/8AiPn04x bLIrGRjlDutNzutRXjkjyDnH0A5bJo2y4NXbwPk1sye08Wq/1W/ZCdQL5WL3am9XIv+s VSH1zn//aNE7Cti6K+utxYHqYy30DKGqCW1lBAfnQUXVOxqGIGe7c3ubI3/SlE9O035D 8xLganCmbG3t6ibXD0CKl7KDIeV9LJAYQIIcyeVs6KXe1oOxz1G/rxjggNjSvzoW4UTE MYtg== X-Gm-Message-State: APjAAAVSS++FoWuIHQOn2Nrh05rDDP40uLC+808gZIW8kYo7oaxDdDHs GvJbqx9oVsSx+R5ka2qVWKU= X-Google-Smtp-Source: APXvYqzlN6oSQizlK9rSWzUbP7VqQOtqOZQV0wP/XsqM91tPV7ceyNFSPuwf919faxKZcukGpUFLcA== X-Received: by 2002:a05:600c:2115:: with SMTP id u21mr9717766wml.70.1552052249344; Fri, 08 Mar 2019 05:37:29 -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.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:28 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 34/46] tools/lib/traceevent: Man pages for tep_filter_event_has_trivial(), tep_update_trivial() and tep_filter_clear_trivial() Date: Fri, 8 Mar 2019 15:36:42 +0200 Message-Id: <20190308133654.21264-35-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_filter_event_has_trivial(), tep_update_trivial() and tep_filter_clear_trivial() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-filter_trivial.txt | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter_trivial.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-filter_trivial.txt b/tools/lib/traceevent/Documentation/libtraceevent-filter_trivial.txt new file mode 100644 index 000000000000..7114192d3640 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-filter_trivial.txt @@ -0,0 +1,112 @@ +libtraceevent(3) +================ + +NAME +---- +tep_filter_event_has_trivial,tep_update_trivial,tep_filter_clear_trivial - Check / update / clear trivial rules of given filter. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum *tep_filter_trivial_type* { + _TEP_FILTER_TRIVIAL_FALSE_, + _TEP_FILTER_TRIVIAL_TRUE_, + _TEP_FILTER_TRIVIAL_BOTH_, +}; + +int *tep_filter_event_has_trivial*(struct tep_event_filter pass:[*]_filter_, int _event_id_, enum tep_filter_trivial_type _type_); +int *tep_update_trivial*(struct tep_event_filter pass:[*]_dest_, struct tep_event_filter pass:[*]_source_, enum tep_filter_trivial_type _type_); +int *tep_filter_clear_trivial*(struct tep_event_filter pass:[*]_filter_, enum tep_filter_trivial_type _type_); +-- + +DESCRIPTION +----------- +The _tep_filter_event_has_trivial()_ function checks if the event with +_event_id_ contains a trivial _filter_ of _type_. + +The _tep_update_trivial()_ function updates the trivial rules with the given +filter. It scans _dest_ for trivial events matching _type_ to replace with +the _source_. + +The _tep_filter_clear_trivial()_ function clears TRUE and FALSE rules. +It removes rules in the _filter_ that only contain a given _type_ boolean arg. + +The trivial _type_, used as argument of these functions can be: +[verse] +-- + _TEP_FILTER_TRIVIAL_FALSE_ - TRUE + _TEP_FILTER_TRIVIAL_TRUE_ - FALSE + _TEP_FILTER_TRIVIAL_BOTH_ - TRUE or FALSE + +-- + +RETURN VALUE +------------ +The _tep_filter_event_has_trivial()_ function returns 1 if the event contains +a matching trivial type, otherwise 0. + +The _tep_update_trivial()_ function returns 0 on success, or -1 if there was +a problem updating, but events may have still been updated on error. + +The _tep_filter_clear_trivial()_ function returns 0 on success, or -1 if there +was a problem. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +struct tep_event_filter *filter1 = tep_filter_alloc(tep); +struct tep_event_filter *filter2 = tep_filter_alloc(tep); +... +if (tep_filter_event_has_trivial(filter1, 1857,TEP_FILTER_TRIVIAL_FALSE) == 0) { + /* There are FALSE rules in filer1 for the event 1857 */ +} + +if (tep_update_trivial(filter1, filter2, TEP_FILTER_TRIVIAL_TRUE) != 0) { + /* Failed to update TRUE trivial rules of filter1 with filter2 */ +} + +if (tep_filter_clear_trivial(filter, TEP_FILTER_TRIVIAL_BOTH) == 0) { + /* Failed to clear TRUE and FALSE trivial rules of filter1 */ +} +... +-- + +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 From patchwork Fri Mar 8 13:36:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844825 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 A13851803 for ; Fri, 8 Mar 2019 13:37:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DA202E435 for ; Fri, 8 Mar 2019 13:37:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 822792E466; Fri, 8 Mar 2019 13:37:32 +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 1412F2E478 for ; Fri, 8 Mar 2019 13:37:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbfCHNhb (ORCPT ); Fri, 8 Mar 2019 08:37:31 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36567 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726746AbfCHNhb (ORCPT ); Fri, 8 Mar 2019 08:37:31 -0500 Received: by mail-wr1-f67.google.com with SMTP id o17so21412049wrw.3 for ; Fri, 08 Mar 2019 05:37:30 -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=4AUlEZDXs0rJc3s+R/Ui2JHLB2ulm6OL4/sNQfEurS0=; b=iw7HDF9EZ8sPtnCf+p06ujKFzHwQxBBqOSyqi6xu2yj1+QEQFMjs8vpg0PmQfh4zrQ z/U+dFf2C+qh4vVxC4wOwRZbdP8ry3Q2paWZDQyc1TxG10kyopFnw8JonKJmBYrCBJAC fXc9qDM8Ffdfvn8xgvYiMplm0kHqTTPeEyqW0cqtTwL59pI034d+KPv7adwafcvuqltV T58YD/HviosAZMekzZBL2FPJkE8e/r25ijnv2VooFob2HjBXm+cplbWDEoo8QbDuD+B+ PovmWxQ3hfNRRcoLfNzD3n2TDeT0+vBmKrcqZ4IIdm5cAOoqWA66Jni6G4aWMX6/Xn6Y zoDw== X-Gm-Message-State: APjAAAX+wBts0dwlBqPclG31Hoka9NmEULucunpxy0Ft3tjlPHW7+KK+ 5LKOpsLo+y8WEeKzcexOszg= X-Google-Smtp-Source: APXvYqzcINXbbvPy+ivMId77wtJDY3quv5zSZU0qDGx0qrPUY4XcelOkkqFAVLK5sAfkLJWuTsQFaA== X-Received: by 2002:a5d:5386:: with SMTP id d6mr10513122wrv.104.1552052250300; Fri, 08 Mar 2019 05:37:30 -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.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:29 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 35/46] tools/lib/traceevent: Man pages for tep_find_function() and tep_find_function_address() Date: Fri, 8 Mar 2019 15:36:43 +0200 Message-Id: <20190308133654.21264-36-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_function() and tep_find_function_address() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-func_find.txt | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_find.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-func_find.txt b/tools/lib/traceevent/Documentation/libtraceevent-func_find.txt new file mode 100644 index 000000000000..04840e244445 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-func_find.txt @@ -0,0 +1,88 @@ +libtraceevent(3) +================ + +NAME +---- +tep_find_function,tep_find_function_address - Find function name / start address. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +const char pass:[*]*tep_find_function*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_); +unsigned long long *tep_find_function_address*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_); +-- + +DESCRIPTION +----------- +These functions can be used to find function name and start address, by given +address. The given address does not have to be exact, it will select the function +that would contain it. + +The _tep_find_function()_ function returns the function name, which contains the +given address _addr_. The _tep_ argument is the trace event parser context. + +The _tep_find_function_address()_ function returns the function start address, +by given address _addr_. The _addr_ does not have to be exact, it will select the +function that would contain it. The _tep_ argument is the trace event parser context. + +RETURN VALUE +------------ +The _tep_find_function()_ function returns the function name, or NULL in case +it cannot be found. + +The _tep_find_function_address()_ function returns the function start address, +or 0 in case it cannot be found. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +void show_function( unsigned long long addr) +{ + const char *fname = tep_find_function(tep, addr); + unsigned long long fstart = tep_find_function_address(tep, addr); + + /* addr is in function named fname, starting at fstart address, at offset (addr - fstart) */ +} +... +-- + +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 From patchwork Fri Mar 8 13:36:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844827 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 1D1831390 for ; Fri, 8 Mar 2019 13:37:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08CCA2E40A for ; Fri, 8 Mar 2019 13:37:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F18BC2E478; Fri, 8 Mar 2019 13:37:33 +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 864EB2E40A for ; Fri, 8 Mar 2019 13:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726746AbfCHNhd (ORCPT ); Fri, 8 Mar 2019 08:37:33 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44837 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726623AbfCHNhd (ORCPT ); Fri, 8 Mar 2019 08:37:33 -0500 Received: by mail-wr1-f68.google.com with SMTP id w2so21389709wrt.11 for ; Fri, 08 Mar 2019 05:37:31 -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=Oo0O/MAZmlGzFkHfBsIxr/+fbcPQYA6JQ+329h6gQlM=; b=DwALBS+sYB+20eVXoXDbyjJtykxSnI92pH8EDOoFmTqEnldAgWwjA1bSuIzPr7zOoV ADAvvRgaTFueMu+KvuwIoAP+ClZitht5QFgBoqLZO2MARGlNBwjqKbZxe1cqGvbkxrLE FQhYDlYVnzVlAgcbBbGp6ErwYJK3a9v+EfM7X7HFY1a71HDYsuxqhiPsqvxrUss968cd 61u+njAWcVorEDPaxtC2T3ONJrV/oK8NVIWmpXagGMJd2Ijirn5a1e+4E8drUJTBhxoj /HS34OrmjFaTWSobSVx6+mjJ0yNCAP/TZJd1+kKw24yWHa4FQLbx3X3yPMHMVKGLuYg4 D3/Q== X-Gm-Message-State: APjAAAW7zv9qUGA+par6fNOSAs9vxsBX2JB/8YpKrWePLCDpS9sxUrXC +jUIV26fvF/v/OKs/ox7QTU= X-Google-Smtp-Source: APXvYqykGFv9oTPVIQQKgkQvdwNKrcGKlwLih0LUQz6gJFBGxqLwHaSqszr09snDtqjiYWNAsQ6wGw== X-Received: by 2002:adf:afe3:: with SMTP id y35mr10840515wrd.318.1552052251239; Fri, 08 Mar 2019 05:37:31 -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.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:30 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 36/46] tools/lib/traceevent: Man pages for tep_set_function_resolver() and tep_reset_function_resolver() Date: Fri, 8 Mar 2019 15:36:44 +0200 Message-Id: <20190308133654.21264-37-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_set_function_resolver() and tep_reset_function_resolver() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-func_resolve.txt | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_resolve.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-func_resolve.txt b/tools/lib/traceevent/Documentation/libtraceevent-func_resolve.txt new file mode 100644 index 000000000000..38b715bd926c --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-func_resolve.txt @@ -0,0 +1,96 @@ +libtraceevent(3) +================ + +NAME +---- +tep_set_function_resolver,tep_reset_function_resolver - Set / reset an alternative function resolver + +SYNOPSIS +-------- +[verse] +-- +*#include * + +typedef char pass:[*](*tep_func_resolver_t*)(void pass:[*]_priv_, unsigned long long pass:[*]_addrp_, char pass:[**]_modp_); + +int *tep_set_function_resolver*(struct tep_handle pass:[*]_tep_, tep_func_resolver_t pass:[*]_func_, void pass:[*]_priv_); +void *tep_reset_function_resolver*(struct tep_handle pass:[*]_tep_); +-- + +DESCRIPTION +----------- +Some tools may have already a way to resolve the kernel functions. These APIs +allow them to keep using it instead of duplicating all the entries inside. + +The _tep_set_function_resolver()_ function registers _func_ as an alternative +kernel functions resolver. The _tep_ argument is trace event parser context. +The _priv_ argument is a custom context of the _func_ function. + +The _tep_reset_function_resolver()_ function resets the kernel functions +resolver to the default function. The _tep_ argument is trace event parser +context. + +The _tep_func_resolver_t_ type is the prototype of the alternative kernel +functions resolver. This function receives a pointer to its custom context +(set with the _tep_set_function_resolver()_ call ) and the address of a kernel +function, which has to be resolved. In case of success, it should return +the name of the function and its module (if any) in _modp_. + +RETURN VALUE +------------ +The _tep_set_function_resolver()_ function returns 0 in case of success, or -1 +in case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +char *my_resolve_kernel_addr(void *context, unsigned long long *addrp, char **modp) +{ + return NULL; +} +... + if (tep_set_function_resolver(tep, my_resolve_kernel_addr, NULL) != 0) { + /* failed to register my_resolve_kernel_addr */ + } +... + tep_reset_function_resolver(tep); +... +-- + +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 From patchwork Fri Mar 8 13:36:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844829 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 7A4DC1803 for ; Fri, 8 Mar 2019 13:37:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 669262E40A for ; Fri, 8 Mar 2019 13:37:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AF9A2E435; Fri, 8 Mar 2019 13:37:34 +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 E68B12E466 for ; Fri, 8 Mar 2019 13:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726748AbfCHNhd (ORCPT ); Fri, 8 Mar 2019 08:37:33 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34722 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfCHNhd (ORCPT ); Fri, 8 Mar 2019 08:37:33 -0500 Received: by mail-wr1-f68.google.com with SMTP id f14so21396742wrg.1 for ; Fri, 08 Mar 2019 05:37:32 -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=eYfbKuT/9aeiIdAap/LKVglvcfScVRvIq0TqaS8lLhk=; b=oQDsY/FCXhJtWG+NEztOalnvT7sDt0NAt6nEmHMLsGlawfeqDXUrozUo6J7obhW2iJ Zn2m4/wZC0a4Y3+R/Vsie+iaibJr8oY1tOjFCG8yq4y+pUIMiaUoRlh6GhMfYq0bBVSA x6oGlc/SYIVVi+TM+DatzCCQ5jvNx/mfnFZmfXpwleoLNXP83EJMiAQ2E13FVeP9L3uL g3lT/eOn6s9udWSFNKyoVEvEmz8QOCtEt5MDakNdiiXnz1GZBTkoRXQuVzWCJzIz35Z6 ikaXkf3OsG7/Xlp1WQq5E87scdrQVlz+5csuL/b52o0d7TbnKIk+Q0pshzP/fu7TfyH4 hnTQ== X-Gm-Message-State: APjAAAWMFoRb+F/WGAY9eTfABGN9Lxdtkwx5Zt93TgN/TFbqy0KSIBSe 76/4r+GCr463gk32p3B/MyI= X-Google-Smtp-Source: APXvYqyTiEbdZwKCxHFGd6X/CMWXsfHXMGbHhDKR/NK4AEvA3cjXnCJZJrdcqPYKH/g18nEos+SDXQ== X-Received: by 2002:adf:edd1:: with SMTP id v17mr11105288wro.300.1552052252102; Fri, 08 Mar 2019 05:37:32 -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.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:31 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 37/46] tools/lib/traceevent: Man pages for tep_parse_event() and tep_parse_format() Date: Fri, 8 Mar 2019 15:36:45 +0200 Message-Id: <20190308133654.21264-38-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_parse_event() and tep_parse_format() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-parse_event.txt | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt b/tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt new file mode 100644 index 000000000000..64c9f0df58aa --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt @@ -0,0 +1,90 @@ +libtraceevent(3) +================ + +NAME +---- +tep_parse_event,tep_parse_format - Parse the event format information + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum tep_errno *tep_parse_event*(struct tep_handle pass:[*]_tep_, const char pass:[*]_buf_, unsigned long _size_, const char pass:[*]_sys_); +enum tep_errno *tep_parse_format*(struct tep_handle pass:[*]_tep_, struct tep_event pass:[*]pass:[*]_eventp_, const char pass:[*]_buf_, unsigned long _size_, const char pass:[*]_sys_); +-- + +DESCRIPTION +----------- +The _tep_parse_event()_ function parses the event format and creates an event +structure to quickly parse raw data for a given event. The _tep_ argument is +the trace event parser context. The created event structure is stored in the +_tep_ context. The _buf_ argument is a buffer with _size_, where the event +format data is. The event format data can be taken from +tracefs/events/.../.../format files. The _sys_ argument is the system of +the event. + +The _tep_parse_format()_ function does the same as _tep_parse_event()_. The only +difference is in the extra _eventp_ argument, where the newly created event +structure is returned. + +RETURN VALUE +------------ +Both _tep_parse_event()_ and _tep_parse_format()_ functions return 0 on success, +or TEP_ERRNO__... in case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +char *buf; +int size; +struct tep_event *event = NULL; +buf = read_file("/sys/kernel/tracing/events/ftrace/print/format", &size); +if (tep_parse_event(tep, buf, size, "ftrace") != 0) { + /* Failed to parse the ftrace print format */ +} + +if (tep_parse_format(tep, &event, buf, size, "ftrace") != 0) { + /* Failed to parse the ftrace print format */ +} +... +-- + +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 From patchwork Fri Mar 8 13:36:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844831 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 D7C811390 for ; Fri, 8 Mar 2019 13:37:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5CBB2E435 for ; Fri, 8 Mar 2019 13:37:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA4FE2E466; Fri, 8 Mar 2019 13:37:35 +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 552502E40A for ; Fri, 8 Mar 2019 13:37:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbfCHNhf (ORCPT ); Fri, 8 Mar 2019 08:37:35 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46381 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726623AbfCHNhe (ORCPT ); Fri, 8 Mar 2019 08:37:34 -0500 Received: by mail-wr1-f66.google.com with SMTP id i16so21376183wrs.13 for ; Fri, 08 Mar 2019 05:37:33 -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=L1IWRStKn+CgkAIQku139tVPIQjflwlXSBx2hL5Nh3Q=; b=RRo/CSDqg+Scuh42muQray2XoS0+lYHlf7k9PZ7CBpF0CINXEm3gBlXB62zlw9kEQU ooALqWQjZQWvzbGqlUDF3O/sNdgRUd6vDFxG9sL2sYF1SRNr8zWRWHFqyF7FXzaAjBQX Z5FBiukNiV1DkCGSgWehpFd9NhznteiNit7yMAOFKkzLNTKU/Kx11j0Nc0SobCvmthj/ CA4mibuyB3/bs65xJ3gRgb7ZQS6r5WcPy3NIp1AMHpyzSEIa0gJdib3cUaA7eRFC2T44 tf/FpxrZAF/55GE59axDwK4VGvNCvgBQ6rz02UKQBsxA/4eX/+UoDds5ufK5wNISX+lF 9ECw== X-Gm-Message-State: APjAAAUwh/uDiTS9Q3L4w1LIydSnOEo5wglLqWoDpTOW54AJzpBD7fPj W1ziaJYtQKnLDOgLt8DIiuc= X-Google-Smtp-Source: APXvYqx5PCeL7hqkWi1IHGOwh+goa575eXnJzjC+6prtzEzz/4yFZxFLhZQfGHHv36arGNBVkDJ62g== X-Received: by 2002:adf:f711:: with SMTP id r17mr2901834wrp.38.1552052253009; Fri, 08 Mar 2019 05:37:33 -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.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:32 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 38/46] tools/lib/traceevent: Man page for tep_parse_header_page() Date: Fri, 8 Mar 2019 15:36:46 +0200 Message-Id: <20190308133654.21264-39-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 page for tep_parse_header_page() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-parse_head.txt | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt b/tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt new file mode 100644 index 000000000000..c90f16c7d8e6 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt @@ -0,0 +1,82 @@ +libtraceevent(3) +================ + +NAME +---- +tep_parse_header_page - Parses the data stored in the header page. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_parse_header_page*(struct tep_handle pass:[*]_tep_, char pass:[*]_buf_, unsigned long _size_, int _long_size_); +-- + +DESCRIPTION +----------- +The _tep_parse_header_page()_ function parses the header page data from _buf_, +and initializes the _tep_, trace event parser context, with it. The buffer +_buf_ is with _size_, and is supposed to be copied from +tracefs/events/header_page. + +Some old kernels do not have header page info, in this case the +_tep_parse_header_page()_ function can be called with _size_ equal to 0. The +_tep_ context is initialized with default values. The _long_size_ can be used in +this use case, to set the size of a long integer to be used. + +RETURN VALUE +------------ +The _tep_parse_header_page()_ function returns 0 in case of success, or -1 +in case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +char *buf; +int size; +buf = read_file("/sys/kernel/tracing/events/header_page", &size); +if (tep_parse_header_page(tep, buf, size, sizeof(unsigned long)) != 0) { + /* Failed to parse the header page */ +} +... +-- + +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 From patchwork Fri Mar 8 13:36:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844833 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 53FC217E9 for ; Fri, 8 Mar 2019 13:37:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40F562E40A for ; Fri, 8 Mar 2019 13:37:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 359E62E466; Fri, 8 Mar 2019 13:37:36 +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 BAAE12E40A for ; Fri, 8 Mar 2019 13:37:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726623AbfCHNhf (ORCPT ); Fri, 8 Mar 2019 08:37:35 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38775 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfCHNhf (ORCPT ); Fri, 8 Mar 2019 08:37:35 -0500 Received: by mail-wr1-f67.google.com with SMTP id g12so21393497wrm.5 for ; Fri, 08 Mar 2019 05:37:34 -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=3GCdyjmtjyV29RvWEmKgohuvdKyvG7AXjIUu9pqvPd8=; b=LIzRW+WTxe/VcEJyHZJ+eB+QyncO6sf2wtOnYbDIHoQzIt9CD5XDpIk5k7l5KMSWiB w4oKHXMB5E6fUMEHSy7Tu9MdHwDYT8hI0WhcoZzng3vDi1l6Ww5x5xGg+JMQh7K7VWxH DCAFr7WLrXO95etE+w7XbfOvyo1LQFTPntxDwyqwYjdZWx5WM+rTVCoQ0OUfs+iJHMpx nyT+REnwNeQPNHpLXRp7v1VP+bfxVlgPAwZxeKI9XzlqJjjfwWKiQxdvN3IbmbrshFne PtJuZZ6XnW0cdN2oJGCSu67uU3BfI3evQl0wVre3055Xnig+FKWgZIv612uOEF2eidDU cTiQ== X-Gm-Message-State: APjAAAV6QDfAl8ekSOCuBTtmkmE8JAbFZU9hU5WnzssOtUDvePIkHYP3 492I6XQ9NuTzlIBpvZvO44d2rjBO X-Google-Smtp-Source: APXvYqzoxtsHILiP825apo9tfj/nSPFyr/+h3WIpY00olXzAEDxMywmdEyvVQMV5wH+oswYOub9oBQ== X-Received: by 2002:adf:8273:: with SMTP id 106mr11488644wrb.34.1552052253850; Fri, 08 Mar 2019 05:37:33 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:33 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 39/46] tools/lib/traceevent: Man pages for tep_load_plugins() and tep_unload_plugin() Date: Fri, 8 Mar 2019 15:36:47 +0200 Message-Id: <20190308133654.21264-40-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_load_plugins() and tep_unload_plugin() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-plugins.txt | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-plugins.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt b/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt new file mode 100644 index 000000000000..0f40d14944c0 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-plugins.txt @@ -0,0 +1,98 @@ +libtraceevent(3) +================ + +NAME +---- +tep_load_plugins,tep_unload_plugins - Load / unload traceevent plugins + +SYNOPSIS +-------- +[verse] +-- +*#include * + +struct tep_plugin_list pass:[*]*tep_load_plugins*(struct tep_handle pass:[*]_tep_); +void *tep_unload_plugins*(struct tep_plugin_list pass:[*]_plugin_list_, struct tep_handle pass:[*]_tep_); +-- + +DESCRIPTION +----------- +The _tep_load_plugins()_ function loads all plugins, located in the plugin +directories. The _tep_ argument is trace event parser context. +The plugin directories are : +[verse] +-- + - System's plugin directory, defined at the library compile time. It + depends on the library installation prefix and usually is + _(install_preffix)/lib/traceevent/plugins_ + - Directory, defined by the environment variable _TRACEEVENT_PLUGIN_DIR_ + - User's plugin directory, located at _~/.traceevent/plugins_ +-- +Loading of plugins can be controlled by the _tep_flags_, using the +_tep_set_flag()_ API: +[verse] +-- + _TEP_DISABLE_SYS_PLUGINS_ - do not load plugins, located in + the system's plugin directory. + _TEP_DISABLE_PLUGINS_ - do not load any plugins. +-- +The _tep_set_flag()_ API must be called before _tep_load_plugins()_. + +The _tep_unload_plugins()_ function unloads the plugins, previously loaded by +_tep_load_plugins()_. The _tep_ argument is trace event parser context. The +_plugin_list_ is the list of loaded plugins, returned by the _tep_load_plugins()_ +function. + +RETURN VALUE +------------ +The _tep_load_plugins()_ function returns a list of successfully loaded plugins, +or NULL in case no plugins are loaded. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +struct tep_plugin_list *plugins = tep_load_plugins(tep); +if (plugins == NULL) { + /* no plugins are loaded */ +} +... +tep_unload_plugins(plugins, tep); +-- + +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)_, _tep_set_flag(3)_ + +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 From patchwork Fri Mar 8 13:36:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844835 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 C13B017E9 for ; Fri, 8 Mar 2019 13:37:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADD5C2E40A for ; Fri, 8 Mar 2019 13:37:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A26B62E466; Fri, 8 Mar 2019 13:37:37 +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 4110D2E40A for ; Fri, 8 Mar 2019 13:37:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbfCHNhh (ORCPT ); Fri, 8 Mar 2019 08:37:37 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40396 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfCHNhg (ORCPT ); Fri, 8 Mar 2019 08:37:36 -0500 Received: by mail-wr1-f68.google.com with SMTP id t6so2189460wrw.7 for ; Fri, 08 Mar 2019 05:37:35 -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=dkTfb07DSfHUuZgYyltvJ7+hZOkAvHIhF2h+y9ewlP4=; b=hBRepYwCBu7A+6Kd3ti0g74Axp2HkiHINnIrfUOHPsw/ePECiNQC+yX23w6D5gp288 gJe4z+/Zka8/mgsE6CPDttwavaf67++VfgdxCSAf0DEfOLSCfnGpk8Pf7BcOS3I5Bw6K uG0GW80iepzHcPC9mlVqIoIOSZEmOhqBfWOTZ7/2c84Mt+/E+ql3PeL13F+o3aH58AP0 rrBLkqh9y9vDaVAkdtt2KRSWP7vebMLBFworScQnEBHXkIfgdz0CcNVHnLHi1O/1JSXJ WRHal7Vn8S/MG0Hx0YBkagFM7MH1PP6ZCiM3++meXjya0xIRls8VFFNB3pEHbcLMIBpe 5ZHg== X-Gm-Message-State: APjAAAUejo2JYuRymq7xO9/9b8GtUkxk+5sI/WPl4P6G1413o1HfTBRk MkobBhX4ZIi8bsuV+R13D1Y= X-Google-Smtp-Source: APXvYqzjvhNhpB3fbGbSjIJeWrf2zXKQ308DX3JNwF8gEk9FxFMPmCYBKNWFt8BhgRPPMdphkVpg9Q== X-Received: by 2002:a5d:6542:: with SMTP id z2mr10908105wrv.237.1552052254970; Fri, 08 Mar 2019 05:37:34 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:34 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 40/46] tools/lib/traceevent: Man page for tep_data_lat_fmt() Date: Fri, 8 Mar 2019 15:36:48 +0200 Message-Id: <20190308133654.21264-41-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 page for tep_data_lat_fmt() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-record_lat.txt | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-record_lat.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-record_lat.txt b/tools/lib/traceevent/Documentation/libtraceevent-record_lat.txt new file mode 100644 index 000000000000..f4e37b186f61 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-record_lat.txt @@ -0,0 +1,77 @@ +libtraceevent(3) +================ + +NAME +---- +tep_data_lat_fmt - Parses the data for the latency format. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +void *tep_data_lat_fmt*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_record pass:[*]_record_); +-- +DESCRIPTION +----------- +The _tep_data_lat_fmt()_ function parses out the latency format (interrupts +disabled, need rescheduling, in hard/soft interrupt, preempt count and +lock depth) from _record_ and places it into the _s_. The _tep_ argument is +the trace event parser context. + +EXAMPLE +------- +[source,c] +-- +#include +#include +... +struct tep_handle *tep = tep_alloc(); +struct trace_seq seq; +trace_seq_init(&seq); +... +void process_record(struct tep_record *record) +{ + /* Place latency information in the seq */ + tep_data_lat_fmt(tep, &seq, record); +} +... +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related APIs. + Trace sequences are used to allow a function to call several other functions + to create a string of data to use. +*-ltraceevent* + Linker switch to add when building a program that uses the library. +-- + +SEE ALSO +-------- +_libtraceevent(3)_, _trace-cmd(1)_,_tep_set_latency_format(3)_ + +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 From patchwork Fri Mar 8 13:36:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844837 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 BD9501390 for ; Fri, 8 Mar 2019 13:37:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A73802E435 for ; Fri, 8 Mar 2019 13:37:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B31B2E40A; Fri, 8 Mar 2019 13:37:38 +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 1F1A32E40A for ; Fri, 8 Mar 2019 13:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726722AbfCHNhh (ORCPT ); Fri, 8 Mar 2019 08:37:37 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39014 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbfCHNhh (ORCPT ); Fri, 8 Mar 2019 08:37:37 -0500 Received: by mail-wm1-f65.google.com with SMTP id z84so12440338wmg.4 for ; Fri, 08 Mar 2019 05:37:36 -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=xE4elAawO1Ad37rMvc88O37Zmg25/gtEYtZZlNcRmQ0=; b=EqhJ6ZkNl5qLYtPOXr9f+G2k8ga02cX06HEXWc3yg5mkLo8QddNu7EV/0kUJ5FfzMp Jou5l84DZkzhXinuMPgnHo2BuFyCvP5vbJ4zd0T1bNL5C0hpAq1N3GbR58U0YAsAMWE2 F+YkYd3IdXBHC6xFSRHc8K9o4mrYGrHnILvnWBBKu5xwSUueLm23Ix5Yw5NbcMFfkd7M BhwpPiy8RnHU00RPfDwotatVUSEjde4u5KR0Vu7/22RhdLZE3cVcZKcjCnP8l3GjU54a VHaoQuaxTdVHli0c6Zwnv/Zhvb24JyP9h4i4Sw9tWlcMlbr5SLwpjZjCv3GbzO5m1hJ/ fuow== X-Gm-Message-State: APjAAAX11JIBz8xG1P6FIzJtnJg5H7z99ApSatYx7TzNY1Ji0gp3/aQ4 ideQAy5tcBuyDLNoP8uWLCc= X-Google-Smtp-Source: APXvYqz65of0AHF65e4pbKc83wUUQuvYUjeL+OgzOoges22IApSJcKLSlGJOJwBSxE++Gan0ROCDAA== X-Received: by 2002:a1c:4844:: with SMTP id v65mr9859304wma.66.1552052256020; Fri, 08 Mar 2019 05:37:36 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:35 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 41/46] tools/lib/traceevent: Man pages for tep_data_type(), tep_data_pid(), tep_data_preempt_count() and tep_data_flags() Date: Fri, 8 Mar 2019 15:36:49 +0200 Message-Id: <20190308133654.21264-42-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_data_type(), tep_data_pid(), tep_data_preempt_count() and tep_data_flags() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-record_parse.txt | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt b/tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt new file mode 100644 index 000000000000..a74581d5c668 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt @@ -0,0 +1,134 @@ +libtraceevent(3) +================ + +NAME +---- +tep_data_type,tep_data_pid,tep_data_preempt_count,tep_data_flags - Extract common fields from a record. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum *trace_flag_type* { + _TRACE_FLAG_IRQS_OFF_, + _TRACE_FLAG_IRQS_NOSUPPOR_, + _TRACE_FLAG_NEED_RESCHED_, + _TRACE_FLAG_HARDIRQ_, + _TRACE_FLAG_SOFTIRQ_, +}; + +int *tep_data_type*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_); +int *tep_data_pid*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_); +int *tep_data_preempt_count*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_); +int *tep_data_flags*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_); +-- + +DESCRIPTION +----------- +This set of functions can be used to extract common fields from a record. + +The _tep_data_type()_ function gets the event id from the record _rec_. It reads +the "common_type" field. The _tep_ argument is the trace event parser context. + +The _tep_data_pid()_ function gets the process id from the record _rec_. It reads +the "common_pid" field. The _tep_ argument is the trace event parser context. + +The _tep_data_preempt_count()_ function gets the preemption count from the record +_rec_. It reads the "common_preempt_count" field. The _tep_ argument is the +trace event parser context. + +The _tep_data_flags()_ function gets the latency flags from the record _rec_. +It reads the "common_flags" field. The _tep_ argument is the trace event parser +context. Supported latency flags are: +[verse] +-- + _TRACE_FLAG_IRQS_OFF_, Interrupts are disabled. + _TRACE_FLAG_IRQS_NOSUPPOR_, Reading IRQ flag is not supported by the architecture. + _TRACE_FLAG_NEED_RESCHED_, Task needs rescheduling. + _TRACE_FLAG_HARDIRQ_, Hard IRQ is running. + _TRACE_FLAG_SOFTIRQ_, Soft IRQ is running. +-- + +RETURN VALUE +------------ +The _tep_data_type()_ function returns an integer, representing the event id. + +The _tep_data_pid()_ function returns an integer, representing the process id + +The _tep_data_preempt_count()_ function returns an integer, representing the +preemption count. + +The _tep_data_flags()_ function returns an integer, representing the latency +flags. Look at the _trace_flag_type_ enum for supported flags. + +All these functions in case of an error return a negative integer. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +void process_record(struct tep_record *record) +{ + int data; + + data = tep_data_type(tep, record); + if (data >= 0) { + /* Got the ID of the event */ + } + + data = tep_data_pid(tep, record); + if (data >= 0) { + /* Got the process ID */ + } + + data = tep_data_preempt_count(tep, record); + if (data >= 0) { + /* Got the preemption count */ + } + + data = tep_data_flags(tep, record); + if (data >= 0) { + /* Got the latency flags */ + } +} +... +-- + +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 From patchwork Fri Mar 8 13:36:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844839 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 D9CDF1803 for ; Fri, 8 Mar 2019 13:37:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C65172E40A for ; Fri, 8 Mar 2019 13:37:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B851A2E466; Fri, 8 Mar 2019 13:37:39 +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 1A43E2E40A for ; Fri, 8 Mar 2019 13:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726754AbfCHNhi (ORCPT ); Fri, 8 Mar 2019 08:37:38 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34731 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726641AbfCHNhi (ORCPT ); Fri, 8 Mar 2019 08:37:38 -0500 Received: by mail-wr1-f68.google.com with SMTP id f14so21397001wrg.1 for ; Fri, 08 Mar 2019 05:37:37 -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=rxaTuOdFyr7viy6HJr4N/sRYnw3ZIhTdXnSHREWJTo0=; b=RlyV/myVfmgHcdbUiFYaeDur66vi/rTzUCQMzVmwTHbbFVpjyPkQnfRJGaFFIW5/M2 M2AQZr7sf/WAc3CJtJWDEWdRqQG2DedCu/suT5U50hzn1Y+NgvZSZAz63MSdNWfM/e6w QK/uN5BgitjoelxgqEIe+RBTryaEXuGpnkxyPrkdoT04ig0hJ+uDakEUhcDKv72s8YPv IohLRsS3DoYynUA0SoPjif2heXb6mYuuL51Hpr2xmmQx+Fu9Ntwy5v7IU6Q4szt6WhT6 0uoEmnKxllaPLaWOxuuXt2q/hX0Y/WUgquF2ebvnpONIcFfHQ9lhclvA2grfp4+vik2X krag== X-Gm-Message-State: APjAAAXAGHWe0/4niS8BmyHFmPJ4CEwwQoZqvgPz6Fbx5i6dgu63JI5W Zqao5wrB00V5KHUoEYdR1M3C1IHi X-Google-Smtp-Source: APXvYqxtdcE7AzMajG8V2V+vePkkLFyw/8r4Lww9sXbSSC/+e87g3GSTfKuBL0S2c/+Xh4YJYvQu7g== X-Received: by 2002:a5d:4686:: with SMTP id u6mr11322144wrq.206.1552052257006; Fri, 08 Mar 2019 05:37:37 -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.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:36 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 42/46] tools/lib/traceevent: Man pages for trace_seq_init() and trace_seq_destroy() Date: Fri, 8 Mar 2019 15:36:50 +0200 Message-Id: <20190308133654.21264-43-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 trace_seq_init() and trace_seq_destroy() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-tseq.txt | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-tseq.txt b/tools/lib/traceevent/Documentation/libtraceevent-tseq.txt new file mode 100644 index 000000000000..d11732c460ba --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-tseq.txt @@ -0,0 +1,76 @@ +libtraceevent(3) +================ + +NAME +---- +trace_seq_init,trace_seq_destroy - Initialize / destroy a trace sequence. + +SYNOPSIS +-------- +[verse] +-- +*#include * +*#include * + +void *trace_seq_init*(struct trace_seq pass:[*]_s_); +void *trace_seq_destroy*(struct trace_seq pass:[*]_s_); +-- + +DESCRIPTION +----------- +Trace sequences are used to allow a function to call several other functions +to create a string of data to use. + +The _trace_seq_init()_ function initializes the trace sequence _s_. + +The _trace_seq_destroy()_ function destroys the trace sequence _s_ and frees +all its resources that it had used. + +EXAMPLE +------- +[source,c] +-- +#include +#include +... +struct trace_seq seq; +trace_seq_init(&seq); +... +trace_seq_destroy(&seq); +... +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related 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 From patchwork Fri Mar 8 13:36:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844841 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 CBFDF17E9 for ; Fri, 8 Mar 2019 13:37:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B98022E435 for ; Fri, 8 Mar 2019 13:37:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE28B2E480; Fri, 8 Mar 2019 13:37:43 +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 471262E435 for ; Fri, 8 Mar 2019 13:37:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbfCHNhl (ORCPT ); Fri, 8 Mar 2019 08:37:41 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:56259 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbfCHNhk (ORCPT ); Fri, 8 Mar 2019 08:37:40 -0500 Received: by mail-wm1-f66.google.com with SMTP id q187so12682625wme.5 for ; Fri, 08 Mar 2019 05:37:38 -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=GEwAHxUPq3/2YFrpcFnPwlBlgq8zhVh31CVdXNYgQYI=; b=pxaohCjk54CR9SpbQGMv5essZMttmANUQvzQ2yxypKLt0dxN+aBmWI2dY+TNrfFsrz kMV5RXiicoae4CpPx9uwopCwxetXmznpjvnLYpd5neScNNIeu+HbhowZBggsgpxichY1 XqLKFUXrHq/GERN4Wxh7N9mlvCzMHTCPB887W1jOn3W5AuTVe600SUgsHrhGrS3bL7sg tgQraCTz84sTpPmZXq0EU0Ddygsfzrz7g+iIzKMx8NQJTEd1F9tGUkof7dUIrsxf8Zh1 iNBr4AIHO+nHz/Y1UZOMfgOYOY0CjFR84oYKGYEFnmhVK8BbhZrgZvE4oZNFy+SKDur9 rixg== X-Gm-Message-State: APjAAAX1u+89JUaX8mxPItSusScTGKUUbFProk6IChFeY3frKmIdiWm8 CmwvEG2D38C13R0p+H/WhpmSNb/H X-Google-Smtp-Source: APXvYqxzil9D/tp2e7o69kdaQB65pKAnIIDr0BT/D4kw0f+EG9Nbal0iC7B+9wDT+GQ74aIO+V8Emg== X-Received: by 2002:a7b:c777:: with SMTP id x23mr9542920wmk.71.1552052258139; Fri, 08 Mar 2019 05:37:38 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:37 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 43/46] tools/lib/traceevent: Man pages for trace_seq_do_fprintf() and trace_seq_do_printf() Date: Fri, 8 Mar 2019 15:36:51 +0200 Message-Id: <20190308133654.21264-44-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 trace_seq_do_fprintf() and trace_seq_do_printf() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-tseq_doprint.txt | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq_doprint.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-tseq_doprint.txt b/tools/lib/traceevent/Documentation/libtraceevent-tseq_doprint.txt new file mode 100644 index 000000000000..dd46a7e05c4f --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-tseq_doprint.txt @@ -0,0 +1,89 @@ +libtraceevent(3) +================ + +NAME +---- +trace_seq_do_fprintf,trace_seq_do_printf - Print the trace sequence buffer to a file. + +SYNOPSIS +-------- +[verse] +-- +*#include * +*#include * + +int *trace_seq_do_printf*(struct trace_seq pass:[*]_s_); +int *trace_seq_do_fprintf*(struct trace_seq pass:[*]_s_, FILE pass:[*]_fp_); +-- + +DESCRIPTION +----------- +Trace sequences are used to allow a function to call several other functions +to create a string of data to use. + +The _trace_seq_do_printf()_ function prints the buffer of trace sequence _s_ to +the standard output stdout. + +The _trace_seq_do_fprintf()_ function prints the buffer of trace sequence _s_ +to the given file _fp_. + +RETURN VALUE +------------ +Both _trace_seq_do_printf()_ and _trace_seq_do_fprintf()_ functions return the +number of printed characters, or -1 in case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +#include +... +struct trace_seq seq; +trace_seq_init(&seq); +... +if (trace_seq_do_printf(&seq) < 0 ) [ + /* Failed to print the buffer of the trace sequence to the standard output */ +} +... +FILE *fp = fopen("trace.txt", "w"); +if (trace_seq_do_fprintf(&seq, fp) < 0 ) [ + /* Failed to print the buffer of the trace sequence to the trace.txt file */ +} +... +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related 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 From patchwork Fri Mar 8 13:36:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844843 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 121E1188D for ; Fri, 8 Mar 2019 13:37:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB2462E466 for ; Fri, 8 Mar 2019 13:37:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFEFA2E435; Fri, 8 Mar 2019 13:37:43 +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 677262E466 for ; Fri, 8 Mar 2019 13:37:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726546AbfCHNhm (ORCPT ); Fri, 8 Mar 2019 08:37:42 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:33290 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726756AbfCHNhl (ORCPT ); Fri, 8 Mar 2019 08:37:41 -0500 Received: by mail-wr1-f66.google.com with SMTP id i12so21395112wrw.0 for ; Fri, 08 Mar 2019 05:37:39 -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=6Z8ZEoOfvX8++ORC0VJqtjDGKMYkB80TdZwRJpGJqOQ=; b=BKRUyOHsr5E9GUadeoWqh1lBUfpGzSszUfXaGvLxXIYdvWCee43MYuEfDdaZk8kSLs csnHt+q+AN8b4CGIWMYoDTR25/kKttamK7nKfCCex2mT1mSfWtahAuHRqopsTyVxEWq8 B6drPZn1sj6RRx1Kh/ATcKYUsOI2GOc3OXnxqJEkjNbNamG+G4ssr0LL2ZIZxd++sqzy Cey9Pq7N3GnCygN9JdCNY+fzRx2jcNZPhDK9xbGvLLcA1bia6wGKxqeco6RPT7VLEfzZ rz1gjfJy7AdbI5i7trdRsYXTgx3h2xyZ3IcfrZC8JobijunrDr6ehprpCSQMjq/sNihp 8hZg== X-Gm-Message-State: APjAAAXhOWnjE8NcnoCRqTKPvRpWWeVdSbrYWfK4ngVb6bNW0NMqs8Zh +UNZEY5A8QaLTsuwql5jLSc= X-Google-Smtp-Source: APXvYqzikZXGKYKs8Oukqf3YNf6QvZGMIVTEWk+Yssp2m7kLxp5wBC0hj8dPkAOThz88RDAa5SSDow== X-Received: by 2002:a5d:4b05:: with SMTP id v5mr1930067wrq.323.1552052259165; Fri, 08 Mar 2019 05:37:39 -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.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:38 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 44/46] tools/lib/traceevent: Man pages for trace_seq_printf() and trace_seq_vprintf() Date: Fri, 8 Mar 2019 15:36:52 +0200 Message-Id: <20190308133654.21264-45-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 trace_seq_printf() and trace_seq_vprintf() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-tseq_print.txt | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq_print.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-tseq_print.txt b/tools/lib/traceevent/Documentation/libtraceevent-tseq_print.txt new file mode 100644 index 000000000000..f0919bcf1fe3 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-tseq_print.txt @@ -0,0 +1,96 @@ +libtraceevent(3) +================ + +NAME +---- +trace_seq_printf,trace_seq_vprintf - Print formated string with arguments in a trace sequence. + +SYNOPSIS +-------- +[verse] +-- +*#include * +*#include * + +int *trace_seq_printf*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, _..._); +int *trace_seq_vprintf*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, va_list _args_); +-- + +DESCRIPTION +----------- +Trace sequences are used to allow a function to call several other functions +to create a string of data to use. + +The _trace_seq_printf()_ function puts a formated string _fmt _with +variable arguments _..._ in the trace sequence _s_. + +The _trace_seq_vprintf()_ function puts a formated string _fmt _with +list of arguments _args_ in the trace sequence _s_. + +RETURN VALUE +------------ + +Both _trace_seq_printf()_ and _trace_seq_vprintf()_ functions return 0 if the +trace oversizes the buffer's free space, the number of characters printed, or +a negative value in case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +#include +... +struct trace_seq seq; +trace_seq_init(&seq); +... +if (trace_seq_printf(&seq, "example print %d", 10) <= 0) { + /* Failed to print in the trace sequence */ +} +... +void my_print(char *format, ...) +{ + va_list ap; + va_start(ap, format); + if (trace_seq_printf(&seq, format, ap) <= 0) { + /* Failed to print in the trace sequence */ + } + va_end(ap); +} +... +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related 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 From patchwork Fri Mar 8 13:36:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844845 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 27CF21869 for ; Fri, 8 Mar 2019 13:37:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 150582E40A for ; Fri, 8 Mar 2019 13:37:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0959B2E4A3; Fri, 8 Mar 2019 13:37:44 +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 8A4EF2E478 for ; Fri, 8 Mar 2019 13:37:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbfCHNhn (ORCPT ); Fri, 8 Mar 2019 08:37:43 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:51454 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726755AbfCHNhm (ORCPT ); Fri, 8 Mar 2019 08:37:42 -0500 Received: by mail-wm1-f65.google.com with SMTP id n19so12557177wmi.1 for ; Fri, 08 Mar 2019 05:37:41 -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=hfr/XW9nWfq0j12kU6DOCXZlcGOGdP2lqwFZ2x5Sn8s=; b=RUUUfDwxZdcDmFqkQVL5c4SbrwWgfNBpkwFCvdR83i1xhdlq6mlCHPEEt3Oz6tZ0cd ApOg2LKglayICXBcItm1PFhMJgJ8JH5r/lBqC9woPs/fMroC7ef/Dt6SjyaaaDzzgM5P EvV6GDBr8ET0u5KBkTK/IWa19yY+W0/U1OGldjmdUShmgDCYZIe32b5Nowm1RrXFyJW0 6NqETTHTPVfxj4d+QcwewHAbI1fdXWAAolJhj9Ct3GEoPgiAGyWQOKCqIpfbMz+8FCJd fysbNIWHtF/sm6ii+Lb9U55IDqfhDYT6sbB5t+Do1A0jwO8eQf/78zRI1wu/BlusswbM yP+g== X-Gm-Message-State: APjAAAVx4fwQNvtfy2/XwiH7LmAuE6gnHBJ2nU58ksL7CZc6Y/8eLaF1 EQEEAiWbm5dn5IPbM/I/k/Y= X-Google-Smtp-Source: APXvYqy/kA6Uyfu/rFRxlWkv29m6sWT6b48dOhV+daYoLPSTWpvjOXHEOhUrlMy0XIfkLJrvPwwgZg== X-Received: by 2002:a1c:1fca:: with SMTP id f193mr8753409wmf.65.1552052260252; Fri, 08 Mar 2019 05:37:40 -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.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:39 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 45/46] tools/lib/traceevent: Man pages for trace_seq_putc() and trace_seq_puts() Date: Fri, 8 Mar 2019 15:36:53 +0200 Message-Id: <20190308133654.21264-46-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 trace_seq_putc() and trace_seq_puts() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-tseq_put.txt | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq_put.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-tseq_put.txt b/tools/lib/traceevent/Documentation/libtraceevent-tseq_put.txt new file mode 100644 index 000000000000..d14d7791d0ef --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-tseq_put.txt @@ -0,0 +1,89 @@ +libtraceevent(3) +================ + +NAME +---- +trace_seq_putc,trace_seq_puts - Put string / character in a trace sequence. + +SYNOPSIS +-------- +[verse] +-- +*#include * +*#include * + +int *trace_seq_putc*(struct trace_seq pass:[*]_s_, unsigned char _c_); +int *trace_seq_puts*(struct trace_seq pass:[*]_s_, const char pass:[*]_str_); +-- + +DESCRIPTION +----------- +Trace sequences are used to allow a function to call several other functions +to create a string of data to use. + +The _trace_seq_putc()_ function puts a single character _c_ in the trace +sequence _s_. + +The _trace_seq_puts()_ function puts a NULL terminated string _str_ in the +trace sequence _s_. + +RETURN VALUE +------------ +Both _trace_seq_putc()_ and _trace_seq_puts()_ functions return the number of +characters put in the trace sequence, or 0 in case of an error. + +EXAMPLE +------- +[source,c] +-- +#include +#include +... +struct trace_seq seq; +trace_seq_init(&seq); +... +if (trace_seq_putc(&seq, ';') != 1) { + /* Failed to put ';' in the trace sequence */ +} +... +char *str = " foo "; +if (trace_seq_puts(&seq, str) != strlen(str)) { + /* Failed to put " foo " in the trace sequence */ +} +... +-- + +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related 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 From patchwork Fri Mar 8 13:36:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10844847 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 D7B9D1923 for ; Fri, 8 Mar 2019 13:37:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C315F2E435 for ; Fri, 8 Mar 2019 13:37:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B77D92E478; Fri, 8 Mar 2019 13:37:44 +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 4B2772E435 for ; Fri, 8 Mar 2019 13:37:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726755AbfCHNho (ORCPT ); Fri, 8 Mar 2019 08:37:44 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54797 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbfCHNhn (ORCPT ); Fri, 8 Mar 2019 08:37:43 -0500 Received: by mail-wm1-f67.google.com with SMTP id f3so12671434wmj.4 for ; Fri, 08 Mar 2019 05:37:41 -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=uF9DYVikNw0nzU/qEt8DMny7TZ9T/e4pyUutAT1d2GQ=; b=I3oAki6mAu1pjA9YY8rypF8m8LgNj2DxOKnddgoypxz8DdifCwFXuUTMiP8uOMvlOx 05Fq9oFVmoQsufjWaoOklzgtljK+7XwQ+a3Mh/uKQjAE3zMNQgz1WalYIEhBYixQHXqF UjoYpU+hqduU26iLQ4mN56u/lyD8uHWcDkHdJUTg8U5ku3JuJW3yXU0N0VDtJZ96Jsns Kn0H7niLk+frN2kXboiprUv83Ia0bcHkdnKfAfV3+oG9l1iiT3MIM5/bxRFETs7YRrUY 9VD1onrVQb8A0mUPL49A3pWKWT7ZHVDMr6MpfIuLUK2RejqhexLns7gvRiN/vo/elfOX uhQg== X-Gm-Message-State: APjAAAU3x2EdDKPBbPBVE6WnVHhl6U2MAsypWNrUgkpyWLBL5bXhixt5 ffwVyROxRrXk6R0NmASKFvQ= X-Google-Smtp-Source: APXvYqxzXv7wI+F0PhL/FzwqJUVXyah4WjI5+hh4NgJNzvzi5JcKzFpMbfdzgGFeOuQ6wIUe33fzWQ== X-Received: by 2002:a7b:c017:: with SMTP id c23mr9057414wmb.50.1552052261109; Fri, 08 Mar 2019 05:37:41 -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.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 05:37:40 -0800 (PST) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v4 46/46] tools/lib/traceevent: Man pages for trace_seq_reset() and trace_seq_terminate() Date: Fri, 8 Mar 2019 15:36:54 +0200 Message-Id: <20190308133654.21264-47-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 trace_seq_reset() and trace_seq_terminate() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-tseq_reset.txt | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq_reset.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-tseq_reset.txt b/tools/lib/traceevent/Documentation/libtraceevent-tseq_reset.txt new file mode 100644 index 000000000000..a70c0b2f152f --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-tseq_reset.txt @@ -0,0 +1,78 @@ +libtraceevent(3) +================ + +NAME +---- +trace_seq_reset,trace_seq_terminate - Reset / terminate a trace sequence. + +SYNOPSIS +-------- +[verse] +-- +*#include * +*#include * + +void *trace_seq_reset*(struct trace_seq pass:[*]_s_); +void *trace_seq_terminate*(struct trace_seq pass:[*]_s_); +-- + +DESCRIPTION +----------- +Trace sequences are used to allow a function to call several other functions +to create a string of data to use. + +The _trace_seq_reset()_ function re-initializes the trace sequence _s_. All +characters already written in _s_ will be deleted. + +The _trace_seq_terminate()_ function terminates the trace sequence _s_. It puts +the null character pass:['\0'] at the end of the buffer. + +EXAMPLE +------- +[source,c] +-- +#include +#include +... +struct trace_seq seq; +trace_seq_init(&seq); +... +trace_seq_reset(&seq); +... +trace_seq_terminate(&seq); +... +-- +FILES +----- +[verse] +-- +*event-parse.h* + Header file to include in order to have access to the library APIs. +*trace-seq.h* + Header file to include in order to have access to trace sequences related 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