Bug 196551
Summary: | hwlat tracer do not work in kernel commandline | ||
---|---|---|---|
Product: | Tracing/Profiling | Reporter: | Ziqian SUN (Zamir) (sztsian) |
Component: | Ftrace | Assignee: | Steven Rostedt (rostedt) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | ||
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 4.11.9-300.fc26.x86_64 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Ziqian SUN (Zamir)
2017-08-01 09:00:48 UTC
Yeah, that's a simple fix. It's because the hwlat tracer is registered at "lateinit" and so is the "clear_boot_tracer" which frees the saved command line, to keep it from being checked after boot up. Since they are both registered to the initcall logic at the same level, it's up to the linker to decide which one runs first. If the clear function goes first, then you have this issue. If hwlat gets called first, then it will work. The fix is to change the clear_boot_tracer to be lateinit_sync() that is called after all the lateinit functions. (In reply to Steven Rostedt from comment #1) > The fix is to change the clear_boot_tracer to be lateinit_sync() that is > called after all the lateinit functions. Thanks for the explain. I've proposed my patch based on your suggestions, and I will build and test today. If it passed my test, shall I send the patch to you or you will fix it yourself? I've already fixed it. I'll be sending the fix to Linus later today. Thanks! (In reply to Steven Rostedt from comment #3) > I've already fixed it. I'll be sending the fix to Linus later today. > > Thanks! Ah great! Thanks for the quick fix! Actually, due to some failed testing (and then going on vacation), the fix just got in today. It is: Commit 4bb0f0e73c8c30917d169c4a0f1ac083690c545b tracing: Call clear_boot_tracer() at lateinit_sync |