Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/bootchart.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ int main(int argc, char *argv[]) {
_cleanup_free_ char *build = NULL;
_cleanup_fclose_ FILE *of = NULL;
_cleanup_close_ int sysfd = -1;
int schfd;
struct ps_struct *ps_first;
double graph_start;
double log_start;
Expand Down Expand Up @@ -351,6 +352,11 @@ int main(int argc, char *argv[]) {
rlim.rlim_max = 4096;
(void) setrlimit(RLIMIT_NOFILE, &rlim);

schfd = open("/proc/sys/kernel/sched_schedstats", O_WRONLY);
if (schfd >= 0)
write(schfd, "1\n", 2);
close(schfd);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't hate me ;)

Can you move the close underneath the if too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd hate it if you hadn't said that, cuz it's obviously not nice like this. :)


/* start with empty ps LL */
ps_first = new0(struct ps_struct, 1);
if (!ps_first) {
Expand Down