-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
softirqs: focus CPU as disector #1130
Conversation
Do you think it makes sense to update tools/softirq.py to key on the CPU id as well? Note for others: to test tools/old/softirq.py on newer kernels, I had to delete the blk_iopoll_softirq kprobe. So the output is now:
I'd make this per-CPU breakdown an option, like -C. I do want the per-softirq summaries by default, especially as my larger systems have 64 CPUs and the output is going to get long. An example of an optional breakdown is biolatency's -D. I haven't encountered the word "dissector" for this feature, we usually use "breakdown", but I can see that dissector is more specific, so I think I like it. :) |
Do you think it makes sense to update tools/softirq.py to key on the
CPU id as well?
Theopractically, it'd. Was a little selfish, since I was running on a
kernel < 4.7. Wanted to sound opinions first.
||
I'd make this per-CPU breakdown an option, like -C.
Right, no objections.
I do want the per-softirq summaries by default, especially as my
larger systems have 64 CPUs and the output is going to get long.
Am handling equally equipped systems. On top, well, it's rather meant as
a "grepable" backend mechanism. Thought of NUMA aware agglomeration for
manual wielding. However, we can leave the status quo in place.
[...] "breakdown", but I can see that dissector is more specific, so I
think I like it. :)
No preferences, merely was the first word appearing to when commencing
on it.
…--
Besten Gruß
Matthias Tafelmeier
|
Right, seems legit now ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple of comments below, and also a bigger question: why does this PR only update tools/old/softirqs.py, and not the new tool that uses tracepoints? That's the one most people will be using by default (on 4.7+ anyway).
tools/old/softirqs.py
Outdated
@@ -33,6 +33,8 @@ | |||
help="output in nanoseconds") | |||
parser.add_argument("-d", "--dist", action="store_true", | |||
help="show distributions as histograms") | |||
parser.add_argument("-C", "--CPUidx", action="store_true", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest a somewhat clearer long option name, perhaps --by-cpu
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No preferences, can do so ...
tools/old/softirqs.py
Outdated
if (tsp == 0 || ipp == 0) { | ||
return 0; // missed start | ||
bpf_text = "" | ||
if args.CPUidx: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot of shared code across the two alternatives, which makes me worried about duplication and potential maintenance problems if we add more "dissectors". What we typically do in other tools is one of two options:
- Embed string markers (like
REPLACEME
) in the C code string and then conditionally replace them with the appropriate code, kind of like you did withCOMMON
here but in the other direction - Use conditional compilation (
#ifdef ...
) in the C code and conditionally prepend the relevant macro definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, technically, I agree, though, I was refraining from making the replacement section a mess. So I had a tradeoff between readability and code duplication in mind.
tools/old/softirqs.py
Outdated
@@ -115,11 +166,18 @@ | |||
"rcu_process_callbacks", "run_rebalance_domains", "tasklet_action", | |||
"tasklet_hi_action", "run_timer_softirq", "net_tx_action", | |||
"net_rx_action"): | |||
b.attach_kprobe(event=softirqfunc, fn_name="trace_start") | |||
b.attach_kretprobe(event=softirqfunc, fn_name="trace_completion") | |||
if args.CPUidx: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, there's no need for this duplication if we give the C functions the same names in both cases. I don't know why not.
[buildbot, add to whitelist] |
I have a couple of comments below, and also a bigger question: why
does this PR only update tools/old/softirqs.py, and not the new tool
that uses tracepoints? That's the one most people will be using by
default (on 4.7+ anyway).
Answered that further up.
…--
Besten Gruß
Matthias Tafelmeier
|
Seems that my versions of argparse doesn't like that. I found s/by-cpu/bycpu/ fixed it. (How come our test system didn't pick it up?). -C also doesn't work with -d:
I filed #1146 for updating tools/softirqs. |
@brendangregg Our smoke tests only run the tools in tools/, not in tools/old/. I generally think of the tools in tools/old/ as unmaintained. |
With having in mind that softirq processing is happeing in ksoftirqd/<cpu> context, which is associated with a specific cpu over the whole dynamic life time of a system, focussing on CPus as the dissector appears more sensical. Quite helpful is this alternative angle of view on the softirqs processing especially for surveilling the effectiveness of net stack tunings, as this is highly dynamic depending on the actual net stack configuration, e.g. scaling or steering. Signed-off-by: Matthias Tafelmeier <matthias.tafelmeier@gmx.net>
Amended things, also the general Softirq per CPU breakdown is working now, though, I don't deem this as very helpful. It might need a nested breakdown per CPU-softirq on top - feel free to add that later. Cheers! |
have been pending for too long. Please resubmit if it's still relevant. |
It is ... pls, reopen in order not to splinter the context. I've not procrastinated it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebase needed?
I don't think so., seemingly, it hasn't been touched on master ever since. |
@cherusk This still only changes tools/old/softirqs.py. Did any situation change in your side so you could make a change in tools/softirqs.py instead? As mentioned in the above, tools/old/... are considered unmaintained and hence will not be tested in bcc testing framework and will not be used by most people. |
@yonghong-song I am prepared to align the tools/softirqs.py to the 'old' symmetrically. Though, landscapes on older kernels (enough out there for stability) will use this one, so please merge it in. |
@4ast could you merge since you requested the change? Note that the code is using kprobe and it will not work on 4.14 kernel as some functions are already gone. |
With having in mind that softirq processing is happeing in
ksoftirqd/ context, which is associated with a specific cpu over
the whole dynamic life time of a system, focussing on CPus as the
disector appears more sensical.
Quite helpful is this alternative angle of view on the softirqs
processing especially for surveilling the effectiveness of net stack
tunings, as this is highly dynamic depending on the actual net stack
configuration, e.g. scaling or steering.
Signed-off-by: Matthias Tafelmeier matthias.tafelmeier@gmx.net