linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v2 2/4] libtracefs: Implement tracefs_kprobe_raw()
Date: Wed, 30 Jun 2021 15:53:54 -0400	[thread overview]
Message-ID: <20210630155354.5f58d68b@oasis.local.home> (raw)
In-Reply-To: <83cee0b8-b9c6-849b-291e-b750815de69e@gmail.com>

On Wed, 30 Jun 2021 22:46:19 +0300
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:

> > +int tracefs_kprobe_raw(const char *system, const char *event,
> > +		       const char *addr, const char *format)
> > +{
> > +	char *str;
> > +	int ret;
> > +
> > +	errno = EBADMSG;
> > +	if (!addr || !format)
> > +		return -1;
> > +
> > +	if (!event)
> > +		event = addr;
> > +
> > +	if (system)
> > +		ret = asprintf(&str, "p:%s/%s %s %s\n",
> > +			       system, event, addr, format);
> > +	else
> > +		ret = asprintf(&str, "p:%s %s %s\n",
> > +			       event, addr, format);  
> 
> I wonder what will be the way to register a "return value" ("r:") 
> kprobe. Do you consider having a separate API for them?

Yes, I was thinking about having a "tracefs_kretprobe_raw()" as well.

I also thought of adding a flag in the parameter, but thought that a
separate function would be better instead.

I wanted to play with this interface before creating the retprobe one.
If you are happy with the current design, I can add that too.

-- Steve

  reply	other threads:[~2021-06-30 19:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-30 15:47 [PATCH v2 0/4] libtracefs: Facilitate adding and removing kprobes Steven Rostedt
2021-06-30 15:47 ` [PATCH v2 1/4] libtracefs: Implement tracefs_instances() Steven Rostedt
2021-06-30 15:47 ` [PATCH v2 2/4] libtracefs: Implement tracefs_kprobe_raw() Steven Rostedt
2021-06-30 19:46   ` Yordan Karadzhov (VMware)
2021-06-30 19:53     ` Steven Rostedt [this message]
2021-06-30 20:05       ` Yordan Karadzhov (VMware)
2021-06-30 15:47 ` [PATCH v2 3/4] libtracefs: Implement tracefs_kprobe_clear() to remove all kprobes Steven Rostedt
2021-06-30 15:47 ` [PATCH v2 4/4] libtracefs: Implement tracefs_kprobe_clear_probe() Steven Rostedt

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=20210630155354.5f58d68b@oasis.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=y.karadz@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).