All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v2 2/4] libtracefs: Implement tracefs_kprobe_raw()
Date: Wed, 30 Jun 2021 23:05:49 +0300	[thread overview]
Message-ID: <d03bfad4-e901-1771-7806-67726c088938@gmail.com> (raw)
In-Reply-To: <20210630155354.5f58d68b@oasis.local.home>



On 30.06.21 г. 22:53, Steven Rostedt wrote:
> 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.
> 

The design looks good to me.

Thanks!
Y.

> -- Steve
> 

  reply	other threads:[~2021-06-30 20:05 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
2021-06-30 20:05       ` Yordan Karadzhov (VMware) [this message]
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=d03bfad4-e901-1771-7806-67726c088938@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.