From: Sameeruddin Shaik <sameeruddin.shaik8@gmail.com>
To: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH] libtracefs: An API to set the filtering of functions
Date: Thu, 4 Mar 2021 15:13:53 +0530 [thread overview]
Message-ID: <CAK7tX=Zk5LC9dSGYJHP9fcFH=wo1-9dgX_529hp6Ys1V5Dcmzg@mail.gmail.com> (raw)
In-Reply-To: <CAPpZLN4h-cXe7j0sBxviQdttD4OT7H=tW5j0=0qYyDCw2XutMg@mail.gmail.com>
sure tzvetomir.
On Thu, Mar 4, 2021 at 2:29 PM Tzvetomir Stoyanov <tz.stoyanov@gmail.com> wrote:
>
> On Thu, Mar 4, 2021 at 9:24 AM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > On Wed, 3 Mar 2021 06:46:26 +0530
> > Sameeruddin Shaik <sameeruddin.shaik8@gmail.com> wrote:
> >
> > > what if we store the indices of the failed filters in an integer array
> > > and return them back?
> >
> > There's not much difference if we return an array of pointers to the
> > filters or an array of integers to the index. I was just thinking about
> > how I would use the interface. When having a working interface, we
> > should write a few robust programs to see how easy it is to use, and
> > that will help in making the API appropriate. This needs to be done
> > *before* we accept it. This particular API is going to be widely used,
> > and it needs to be simple and robust.
>
> One remark, not directly related to this discussion. When the implementation
> of the API is ready, there should be a unit test (in a separate patch) - as for
> any of the other APIs. Usually these are the first use cases that I write for
> the new APIs.
> Sameer, please look at utest directory where the unit tests are, each API has
> a unit test there. We use the cunit framework, ask if there are questions about
> it. This should be the next step, when the final version of the
> implementation is
> ready.
> Thanks!
>
> >
> > > let's return the number of bytes written, also we will calculate the
> > > complete filters length and return it, if there is difference,
> > > we will loop into the integer array and print the erroneous filters
> >
> > Not sure how that is helpful. How would you use the number of bytes
> > written?
> >
> > >
> > > Let's fix the number of parameters to this function:)
> >
> > Not sure what you mean by that.
> >
> >
> > Here's how I envision this interface.
> >
> > char **errs;
> > char *filters[] = {
> > "sched*", "spin_*", NULL
> > };
> > int ret;
> >
> >
> > ret = tracefs_function_filter(NULL, filters, NULL, &errs);
> > if (ret < 0) {
> > int i;
> >
> > printf("Failed to apply: ");
> > for (i = 0; errs[i]; i++) {
> > if (i)
> > printf(", ");
> > printf("'%s'", errs[i]);
> > }
> > printf("\n";
> > exit(ret);
> > }
> >
> > -- Steve
>
>
>
> --
> Tzvetomir (Ceco) Stoyanov
> VMware Open Source Technology Center
next prev parent reply other threads:[~2021-03-04 9:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 17:15 [PATCH] libtracefs: An API to set the filtering of functions Sameeruddin shaik
2021-03-01 18:17 ` Steven Rostedt
2021-03-02 4:21 ` Tzvetomir Stoyanov
2021-03-02 5:14 ` Sameeruddin Shaik
2021-03-02 13:15 ` Steven Rostedt
2021-03-03 1:16 ` Sameeruddin Shaik
2021-03-02 1:28 ` Steven Rostedt
2021-03-04 8:59 ` Tzvetomir Stoyanov
2021-03-04 9:43 ` Sameeruddin Shaik [this message]
2021-03-06 11:20 Sameeruddin shaik
2021-03-05 12:20 ` Tzvetomir Stoyanov
2021-03-05 14:39 ` Steven Rostedt
2021-03-05 14:54 ` Steven Rostedt
2021-03-06 1:55 ` Sameeruddin Shaik
2021-03-06 3:39 ` Steven Rostedt
2021-03-06 4:29 ` Sameeruddin Shaik
2021-03-06 5:19 ` Steven Rostedt
2021-03-06 15:05 ` Steven Rostedt
2021-03-08 23:53 ` Sameeruddin Shaik
2021-03-10 16:21 Sameeruddin shaik
2021-03-10 5:28 ` Tzvetomir Stoyanov
2021-03-10 16:51 ` Sameeruddin Shaik
2021-03-10 5:28 ` Tzvetomir Stoyanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAK7tX=Zk5LC9dSGYJHP9fcFH=wo1-9dgX_529hp6Ys1V5Dcmzg@mail.gmail.com' \
--to=sameeruddin.shaik8@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tz.stoyanov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).