Skip to content

RFC RAS daemon prototype, v1

Borislav Petkov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest21 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21perf_events: Export buffer handling functionsinclude/linux/perf_event.h kernel/perf_event.c+12 -40 replies
2/21mce: Add persistent eventsarch/x86/kernel/cpu/mcheck/mce.c+89 -00 replies
3/21perf_events: Add a helper to search for an event in a contextkernel/perf_event.c+21 -00 replies
4/21perf_events: Handle persistent events accordinglyinclude/linux/perf_event.h kernel/perf_event.c+28 -50 replies
5/21perf: rewire generic library stuff, p1tools/Makefile tools/Makefile.lib tools/lib/Makefile +14 more+308 -2120 replies
6/21perf: rewire generic library stuff, p2tools/lib/Makefile tools/lib/lk/cpumap.c tools/lib/lk/ctype.c +62 more+783 -7830 replies
7/21perf: rewire generic library stuff, p3tools/lib/Makefile tools/lib/lk/pstack.c tools/lib/lk/pstack.h +12 more+426 -4210 replies
8/21perf: rewire generic library stuff, p4tools/lib/Makefile tools/lib/lk/color.c tools/lib/lk/color.h +24 more+875 -8650 replies
9/21perf: rewire generic library stuff, p5tools/lib/Makefile tools/lib/lk/debug.c tools/lib/lk/debug.h +41 more+509 -4840 replies
10/21perf: rewire generic library stuff, p6tools/lib/Makefile tools/lib/lk/strlist.c tools/lib/lk/strlist.h +12 more+293 -2930 replies
11/21perf: Export /proc/mounts parsertools/lib/lk/debugfs.c tools/lib/lk/debugfs.h tools/perf/perf.c +2 more+34 -260 replies
12/21perf: Carve out perf bits for general usage, p1tools/Makefile tools/lib/Makefile tools/lib/perf/header.c +27 more+2364 -23630 replies
13/21perf: Carve out perf bits for general usage, p2tools/Makefile tools/lib/Makefile tools/lib/perf/header.c +43 more+4570 -45690 replies
14/21perf: Carve out perf bits for general usage, p3tools/lib/Makefile tools/lib/lk/debug.h tools/lib/perf/build-id.c +44 more+3044 -30460 replies
15/21perf: Export trace event utilstools/lib/Makefile tools/lib/trace/trace-event-info.c tools/lib/trace/trace-event-parse.c +5 more+4338 -43382 replies
16/21perf: Add a common misc.c compilation unittools/lib/Makefile tools/lib/lk/color.c tools/lib/lk/color.h +11 more+83 -380 replies
17/21perf: Carve out mmap helpers for general usetools/lib/Makefile tools/lib/perf/mmap.c tools/lib/perf/mmap.h +2 more+129 -1190 replies
18/21perf: Split build-id.ctools/lib/perf/build-id.c tools/lib/perf/build-id.h tools/perf/Makefile +1 more+53 -490 replies
19/21x86, mce: Notify about corrected events tooarch/x86/kernel/cpu/mcheck/mce.c+1 -00 replies
20/21amd64_edac: Remove polling mechanismdrivers/edac/amd64_edac.c drivers/edac/edac_mce_amd.c+8 -1260 replies
21/21tools, ras: Add a RAS daemontools/Makefile tools/lib/Makefile tools/ras/Makefile +1 more+178 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/21] RAS daemon prototype, v1

From: Borislav Petkov <[email protected]>

(resubmitting since lkml wasn't on CC list)

Hi guys,

here's the first rough version of all the jerky code that attempts to implement a RAS daemon listening for MCEs using perf. This is a preview code only, I still need to figure out how to do the sample parsing the easiest and flesh out the daemon functionality a bit more. Also, I wanted to reuse as much code as possible therefore a lot had to be reengineered with the perf tool and all its library-like compilation units.

With this, you can do

make perf

or

make ras

and build the respective tool.

Even though I tried to split the patchset for easier review, please bear in mind that there are some fat guys there (241K is the biggest one). However, they don't do anything special except moving code around. As such, they might not appear on lkml due to vger size constraints so I've upped the whole patchset also at

git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git perf-v1

The patchset is based on tip/perf/core from last week. Here are some more details to some of the patches individually:

2: enables the mce tracepoint unconditionally. I had a problem with perf_event_attr.sample_period which is checked in perf_swevent_add(). Currently, I'm setting it to ULLONG_MAX but this is icky. I'd much rather have the check do something like

	if (event->type != PERF_EVENT_TYPE_PERSISTENT)
		if (!hwc->sample_period)
			return;

or similar.

4: sys_perf_event_open needs to know about already allocated and enabled events.

5-10: carves out a bunch of generic perf compilation units into a common lib. Split into 5 patches for easier review.

12-14: those are pulled in when exporting parse_events.c for external use.

16: lib/perf/misc.c contains functions and global variables like pager_in_use() or perf_guest or usage_with_options() which are used in generic utilities but are strictly perf-specific. Long term we should strive in making the library self-contained and getting rid of those.

19-20: those are only needed for testing, they'll go in over the edac tree in the next merge window. Added for completeness here.

21: only bare-bones implementation, needs a lot of fleshing out

Anyways, please have a look and let me know either way :)

Thanks,
Boris.