From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>,
linux-kernel@vger.kernel.org, pi3orama@163.com,
Adrian Hunter <adrian.hunter@intel.com>,
Ingo Molnar <mingo@kernel.org>, David Ahern <dsahern@gmail.com>,
Jiri Olsa <jolsa@kernel.org>,
Milian Wolff <milian.wolff@kdab.com>,
Namhyung Kim <namhyung@kernel.org>,
Brendan Gregg <brendan.d.gregg@gmail.com>
Subject: Re: [PATCH] perf tools: Add sample types for bpf-output event
Date: Fri, 1 Apr 2016 12:19:30 -0300 [thread overview]
Message-ID: <20160401151930.GB9494@redhat.com> (raw)
In-Reply-To: <20160401151610.GG7115@kernel.org>
Em Fri, Apr 01, 2016 at 12:16:10PM -0300, Arnaldo Carvalho de Melo escreveu:
> Perhaps, to make all more familiar we could even define equivalents to
> stdio.h functions like puts, printf, fputs, etc, that would send to this
> bpf-output based "stdout" "channel", then the above would end up being:
>
> func(void *ctx, int type)
> {
> char err_str[] = "BAD %d\n";
> int err;
>
> err = puts("Raise a BPF event!");
> if (err)
> trace_printk(err_str, sizeof(err_str), err);
> return 1;
> }
>
> This trace_printk() in turn could become error() (glibc's error.h header), i.e.
> the error mechanism would use the equivalent to userland's "syslog", i.e.
> trace_printk :-)
>
> In general trying to make BPF C scriptlets fed via perf to be as compact as
> possible, hiding all these details while allowing them to be used, if desired.
One extra possibility would be that it would look so much like a user
space C program that we could test it without loading it to the kernel,
with just building it with a different header and feeding it data as it
would get inside the kernel :-)
- Arnaldo
next prev parent reply other threads:[~2016-04-01 15:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 13:26 [PATCH] perf tools: Add sample types for bpf-output event Wang Nan
2016-04-01 15:16 ` Arnaldo Carvalho de Melo
2016-04-01 15:19 ` Arnaldo Carvalho de Melo [this message]
2016-04-06 7:10 ` [tip:perf/core] perf bpf: Add sample types for 'bpf-output' event tip-bot for Wang Nan
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=20160401151930.GB9494@redhat.com \
--to=acme@redhat.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=brendan.d.gregg@gmail.com \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=milian.wolff@kdab.com \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=pi3orama@163.com \
--cc=wangnan0@huawei.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).