From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DD14C433E1 for ; Tue, 14 Jul 2020 14:28:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59A5D22518 for ; Tue, 14 Jul 2020 14:28:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726187AbgGNO2Q (ORCPT ); Tue, 14 Jul 2020 10:28:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:49784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgGNO2Q (ORCPT ); Tue, 14 Jul 2020 10:28:16 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 21A9922518; Tue, 14 Jul 2020 14:28:15 +0000 (UTC) Date: Tue, 14 Jul 2020 10:28:13 -0400 From: Steven Rostedt To: "Tzvetomir Stoyanov (VMware)" Cc: linux-trace-devel@vger.kernel.org, namhyung@kernel.org Subject: Re: [PATCH 1/8] trace-cmd: Document tep_load_plugins_hook() Message-ID: <20200714102813.2d9434d6@oasis.local.home> In-Reply-To: <20200714103027.2477584-2-tz.stoyanov@gmail.com> References: <20200714103027.2477584-1-tz.stoyanov@gmail.com> <20200714103027.2477584-2-tz.stoyanov@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org On Tue, 14 Jul 2020 13:30:20 +0300 "Tzvetomir Stoyanov (VMware)" wrote: > Add description of tep_load_plugins_hook() traceevent API. > Should add: Link: https://lore.kernel.org/r/CAM9d7cgLBWCrEHwz+Lhv5x5EXGcNWB0QQoeGh3OKh2JfR=dV9Q@mail.gmail.com (you get that part after '/r/' from the message ID in the email.) > Suggested-by: Namhyung Kim > Signed-off-by: Tzvetomir Stoyanov (VMware) > --- > lib/traceevent/event-plugin.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/lib/traceevent/event-plugin.c b/lib/traceevent/event-plugin.c > index 30c1526d..c11636ce 100644 > --- a/lib/traceevent/event-plugin.c > +++ b/lib/traceevent/event-plugin.c > @@ -544,6 +544,22 @@ load_plugins_dir(struct tep_handle *tep, const char *suffix, > closedir(dir); > } > > +/** > + * tep_load_plugins_hook - call a user specified callback to load a plugin > + * @tep: handler to traceevent context > + * @suffix: filter only plugin files with given suffix > + * @load_plugin: user specified callback, called for each plugin file > + * @data: custom context, passed to @load_plugin > + * > + * Searches for traceevent plugin files and calls @load_plugin for each > + * The order of plugins search is: > + * - Directories, specified in @tep->plugins_dir and priority TEP_PLUGIN_FIRST > + * - Directory, specified at compile time with PLUGIN_TRACEEVENT_DIR > + * - Directory, specified by environment variable TRACEEVENT_PLUGIN_DIR > + * - In user's home: ~/.local/lib/traceevent/plugins/ > + * - Directories, specified in @tep->plugins_dir and priority TEP_PLUGIN_LAST We should probably have a man page as well. Thanks Tzvetomir! -- Steve > + * > + */ > void tep_load_plugins_hook(struct tep_handle *tep, const char *suffix, > void (*load_plugin)(struct tep_handle *tep, > const char *path,