Skip to content
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

switch on schedstat support via sysctl on newer kernel #12

Closed
mbiebl opened this issue Jul 20, 2016 · 3 comments
Closed

switch on schedstat support via sysctl on newer kernel #12

mbiebl opened this issue Jul 20, 2016 · 3 comments

Comments

@mbiebl
Copy link

mbiebl commented Jul 20, 2016

As of kernel 4.6, there is now a run-time switch for schedstats support, which defaults to disabled.
It can be switched on via a kernel command line parameter or sysctl [1]

Please update systemd-bootchart to automatically flip that runtime switch via sysctl so fiddling with the kernel command line is not necessary.

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=cb2517653fccaf9f9b4ae968c7ee005c1bbacd

@sofar
Copy link
Contributor

sofar commented Jul 26, 2016

Good catch.

I think we can just write 1 to /proc/sys/kernel/sched_schedstats and ignore any errors. If the file is missing it's likely an older kernel, or the feature is disabled.

We may just want to leave a note in the bootchart.svg that schedstats are possibly disabled.

@sofar sofar closed this as completed in #16 Sep 14, 2016
sofar added a commit that referenced this issue Sep 14, 2016
Newer kernels have schedstat disabled by default unless turned on
at runtime or through a kernel parameter/syscall. We should turn
this on irregardless if we can.

If the kernel is too old, any errors in this code will be ignored
as schedstat should be enabled already.

Fixes #12.
sofar added a commit that referenced this issue Sep 14, 2016
Newer kernels have schedstat disabled by default unless turned on
at runtime or through a kernel parameter/syscall. We should turn
this on irregardless if we can.

If the kernel is too old, any errors in this code will be ignored
as schedstat should be enabled already.

Fixes #12.
@mbiebl
Copy link
Author

mbiebl commented Sep 14, 2016

Yep, works nicely now (on Debian unstable with kernel 4.7.0-1-amd64)

@sofar
Copy link
Contributor

sofar commented Sep 14, 2016

Awesome, thanks for confirming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants