Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #201 from sched-ext/htejun/dump
Browse files Browse the repository at this point in the history
Improve debug dump
  • Loading branch information
htejun authored May 9, 2024
2 parents d61d98e + d180eff commit 5a00279
Show file tree
Hide file tree
Showing 6 changed files with 314 additions and 129 deletions.
7 changes: 7 additions & 0 deletions Documentation/scheduler/sched-ext.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ programs - the BPF scheduler.
a runnable task stalls, or on invoking the SysRq key sequence
:kbd:`SysRq-S`.

* When the BPF scheduler triggers an error, debug information is dumped to
aid debugging. The debug dump is passed to and printed out by the
scheduler binary. The debug dump can also be accessed through the
`sched_ext_dump` tracepoint. The SysRq key sequence :kbd:`SysRq-D`
triggers a debug dump. This doesn't terminate the BPF scheduler and can
only be read through the tracepoint.

Switching to and from sched_ext
===============================

Expand Down
32 changes: 32 additions & 0 deletions include/trace/events/sched_ext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM sched_ext

#if !defined(_TRACE_SCHED_EXT_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_SCHED_EXT_H

#include <linux/tracepoint.h>

TRACE_EVENT(sched_ext_dump,

TP_PROTO(const char *line),

TP_ARGS(line),

TP_STRUCT__entry(
__string(line, line)
),

TP_fast_assign(
__assign_str(line, line);
),

TP_printk("%s",
__get_str(line)
)
);

#endif /* _TRACE_SCHED_EXT_H */

/* This part must be outside protection */
#include <trace/define_trace.h>
Loading

0 comments on commit 5a00279

Please sign in to comment.