From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Devin Moore <devinmoore@google.com>,
LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH v4 0/6] bootconfig: Add mixed subkeys and value under the same key
Date: Fri, 11 Jun 2021 08:56:35 +0900 [thread overview]
Message-ID: <20210611085635.f1655f08b7d8abc009776b6b@kernel.org> (raw)
In-Reply-To: <20210610123852.606aa3a4@oasis.local.home>
[-- Attachment #1: Type: text/plain, Size: 1236 bytes --]
On Thu, 10 Jun 2021 12:38:52 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Thu, 10 Jun 2021 12:26:07 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > I should set up a ktest config file that reads each of the example
> > bootconfigs, and boots the kernel, and checks that each of them took
> > affect without doing any other side effects.
Thanks for adding bootconfig to the ktest!
> >
> > I'll work to create a ktest config sample to test them, and send them
> > out.
>
> The sample configs seem to be just that, samples, and not something
> that I can just load.
>
> Do you have a set of bootconfig scripts I could use to load and boot
> the kernel and make sure that they did what they intended to do?
Yes, I have some example scripts. But maybe smaller example will be
better for test?
Let me break those example so that you can easily test that.
Also, you can find some syntax examples under tools/bootconfig/samples/.
(But I think those are already tested by bootconfig command anyway)
>
> Then I can make a series of ktest tests to test each one.
>
> In the mean time, I'll just push out the branch to linux-next.
Thank you!
>
> Thanks!
>
> -- Steve
--
Masami Hiramatsu <mhiramat@kernel.org>
[-- Attachment #2: boottrace.bconf --]
[-- Type: application/octet-stream, Size: 1294 bytes --]
ftrace.event {
task.task_newtask {
filter = "pid < 128"
enable
}
kprobes.vfs_read {
probes = "vfs_read $arg1 $arg2"
filter = "common_pid < 200"
enable
}
synthetic.initcall_latency {
fields = "unsigned long func", "u64 lat"
actions = "hist:keys=func.sym,lat:vals=lat:sort=lat"
}
initcall.initcall_start {
actions = "hist:keys=func:ts0=common_timestamp.usecs"
}
initcall.initcall_finish {
actions = "hist:keys=func:lat=common_timestamp.usecs-$ts0:onmatch(initcall.initcall_start).initcall_latency(func,$lat)"
}
}
ftrace.instance {
foo {
tracer = "function"
ftrace.filters = "user_*"
cpumask = 1
options = nosym-addr
buffer_size = 512KB
trace_clock = mono
event.signal.signal_deliver.actions=snapshot
}
bar {
tracer = "function"
ftrace.filters = "kernel_*"
cpumask = 2
trace_clock = x86-tsc
}
}
ftrace.alloc_snapshot
kernel {
trace_options = sym-addr
trace_events = "initcall:*"
# tp_printk
trace_buf_size = 1M
ftrace = function
ftrace_filter = "vfs*"
}
[-- Attachment #3: tracing.bconf --]
[-- Type: application/octet-stream, Size: 1129 bytes --]
ftrace {
tracer = function;
options = event-fork, sym-addr, stacktrace;
buffer_size = 1M;
alloc_snapshot;
trace_clock = global;
events = "task:task_newtask", "initcall:*";
event.sched.sched_process_exec {
filter = "pid < 128";
}
event.kprobes.myevent {
probes = "vfs_read $arg1 $arg2", "vfs_write $arg1 $arg2"
}
event.kprobes.myevent2 {
probes = "initrd_load";
}
event.kprobes.enable
instance.bar {
event.synthetic.initcall_latency {
fields = "unsigned long func", "u64 lat";
actions.hist {
keys = func.sym, lat;
vals = lat;
sort = lat;
}
}
event.initcall {
initcall_start.actions.hist {
keys = func;
ts0 = "common_timestamp.usecs";
}
initcall_finish.actions.hist {
keys = "func";
lat = "common_timestamp.usecs-$ts0";
onmatch = "initcall.initcall_start",
"initcall_latency(func,$lat)";
}
}
}
instance.foo {
tracer = function-graph;
tracing_on = false;
event.workqueue.workqueue_start.actions = "tracing_on";
event.workqueue.workqueue_end.actions = "tracing_off";
};
}
kernel {
tp_printk;
dump_on_oops = 2
traceoff_on_warning
}
[-- Attachment #4: functiongraph.bconf --]
[-- Type: application/octet-stream, Size: 403 bytes --]
ftrace {
tracing_on = 0 # off by default
tracer = function_graph
event.kprobes {
start_event {
probes = "pci_proc_init"
actions = "traceon"
}
end_event {
probes = "pci_proc_init%return"
actions = "traceoff"
}
}
}
[-- Attachment #5: ftrace.bconf --]
[-- Type: application/octet-stream, Size: 1526 bytes --]
#!/bin/sh
ftrace {
options = "sym-addr", "context-info"
buffer_size = 1MB
}
ftrace.event {
# Sample1: Make a histogram for initcall functions
synthetic.initcall_latency {
fields = "unsigned long func", "u64 lat"
hist {
keys = func.sym, lat
vals = lat
sort = lat
}
}
initcall.initcall_start.hist {
keys = func
var.ts0 = common_timestamp.usecs
}
initcall.initcall_finish.hist {
keys = func
var.lat = common_timestamp.usecs - $ts0
onmatch {
event = initcall.initcall_start
action = "initcall_latency(func, $lat)"
}
}
# Sample2: kmalloc() tracing in read(2) syscall
syscalls.sys_enter_read.enable_event {
event = kmem.kmalloc
count = 1
}
syscalls.sys_exit_read.disable_event {
event = kmem.kmalloc
}
# Sample3: Stacktrace at the event
kmem.kmalloc.stacktrace {
count = 5
filter = 'bytes_req >= 65536'
}
# Sample4: Take a snapshot
block.block_unplug.snapshot {
count = 1
filter = nr_rq > 1
}
# Sample5: Trace-on/off
block.block_plug.traceon {
filter = nr_rq > 1
}
block.block_unplug.traceoff {
filter = nr_rq > 1
}
# Sample6: onmax
sched.sched_waking {
enable
hist {
keys = pid
ts1 = common_timestamp.usecs
filter = 'comm == "cyclictest"'
}
}
sched.sched_switch {
enable
hist {
keys = next_pid
var.wakeup_lat = common_timestamp.usecs - $ts1
onmax {
var = wakeup_lat
action = "save(next_prio,next_comm,prev_pid,prev_prio,prev_comm)"
}
filter = 'next_comm == "cyclictest"'
}
}
}
next prev parent reply other threads:[~2021-06-10 23:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-02 8:18 [PATCH v4 0/6] bootconfig: Add mixed subkeys and value under the same key Masami Hiramatsu
2021-06-02 8:18 ` [PATCH v4 1/6] tools/bootconfig: Fix a build error accroding to undefined fallthrough Masami Hiramatsu
2021-06-02 8:18 ` [PATCH v4 2/6] bootconfig: Change array value to use child node Masami Hiramatsu
2021-06-02 8:19 ` [PATCH v4 3/6] bootconfig: Support mixing a value and subkeys under a key Masami Hiramatsu
2021-06-02 8:19 ` [PATCH v4 4/6] tools/bootconfig: Support mixed value and subkey test cases Masami Hiramatsu
2021-06-02 8:19 ` [PATCH v4 5/6] docs: bootconfig: Update for mixing value and subkeys Masami Hiramatsu
2021-06-02 8:19 ` [PATCH v4 6/6] bootconfig: Share the checksum function with tools Masami Hiramatsu
2021-06-02 23:02 ` [PATCH v4 0/6] bootconfig: Add mixed subkeys and value under the same key Devin Moore
2021-06-10 14:48 ` Masami Hiramatsu
2021-06-10 16:26 ` Steven Rostedt
2021-06-10 16:38 ` Steven Rostedt
2021-06-10 16:48 ` Steven Rostedt
2021-06-10 23:56 ` Masami Hiramatsu [this message]
2021-06-16 19:17 ` Steven Rostedt
2021-06-17 1:27 ` Masami Hiramatsu
2021-06-16 21:21 ` Steven Rostedt
2021-06-17 1:31 ` 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=20210611085635.f1655f08b7d8abc009776b6b@kernel.org \
--to=mhiramat@kernel.org \
--cc=devinmoore@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@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.