From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
<linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Subject: Re: [PATCH] kprobes: Print an error if probe is rejected
Date: Fri, 11 Jun 2021 10:50:11 +0900 [thread overview]
Message-ID: <20210611105011.092650f2b921ce36325eff79@kernel.org> (raw)
In-Reply-To: <20210610133346.4a55c60a@oasis.local.home>
On Thu, 10 Jun 2021 13:33:46 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Thu, 10 Jun 2021 19:16:43 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> > Hmm, Nack for this way, but I understand that is a problem.
> > If you got the error in perf probe, which uses ftrace dynamic-event interface.
> > In that case, the errors should not be output in the dmesg, but are reported
> > via error_log in tracefs.
> > And kprobes itself should return different error code to the caller, instead
> > of printing error in dmesg. See below.
>
> We should update perf to use libtracefs that also has an interface to
> read the error_log file.
Hmm, it seems that libtracefs has no parser for the error_log file.
What we need is to parse error_log and find appropriate entry of
the error log. Thus, the interface will be;
int tracefs_add_dynamic_event(const char *command, char **error_log);
And the usage will be;
ret = tracefs_add_dynamic_event(command, &error_buf);
if (ret < 0) {
pr_error("Failed to add dynamic event: %d\n", ret);
pr_error("Error log:\n%s\n", error_buf);
free(error_buf);
return ret;
}
...
This is because error_log file keeps some previous error logs and
you need to find appropriate one from the actual command.
Maybe a part of perf probe (util/probe-file.c) should be shared with
libtracefs and finally it should moved on the libtracefs.
Thank you,
--
Masami Hiramatsu <mhiramat@kernel.org>
next prev parent reply other threads:[~2021-06-11 1:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-10 8:56 [PATCH] kprobes: Print an error if probe is rejected Naveen N. Rao
2021-06-10 10:16 ` Masami Hiramatsu
2021-06-10 17:33 ` Steven Rostedt
2021-06-11 1:50 ` Masami Hiramatsu [this message]
2021-06-11 13:55 ` Naveen N. Rao
2021-06-11 19:40 ` Steven Rostedt
2021-06-14 15:30 ` Naveen N. Rao
2021-06-18 16:15 ` Masami Hiramatsu
2021-06-21 9:36 ` Naveen N. Rao
2021-06-21 12:54 ` Masami Hiramatsu
2021-06-12 1:13 ` Masami Hiramatsu
2021-06-14 15:37 ` Naveen N. Rao
2021-06-15 5:42 ` Masami Hiramatsu
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=20210611105011.092650f2b921ce36325eff79@kernel.org \
--to=mhiramat@kernel.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox