Skip to content

Commit ba82664

Browse files
virtuosogregkh
authored andcommitted
intel_th: Add Memory Storage Unit driver
Memory Storage Unit (MSU) is a trace output device that collects trace data to system memory. It consists of 2 independent Memory Storage Controllers (MSCs). This driver provides userspace interfaces to configure in-memory tracing parameters, such as contiguous (high-order allocation) buffer or multiblock (scatter list) buffer mode, wrapping (data overwrite) and number and sizes of windows in multiblock mode. Userspace can read the buffers via mmap()ing or read()ing of the corresponding device node. Signed-off-by: Laurent Fert <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f04e449 commit ba82664

File tree

5 files changed

+1671
-0
lines changed

5 files changed

+1671
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
What: /sys/bus/intel_th/devices/<intel_th_id>-msc<msc-id>/wrap
2+
Date: June 2015
3+
KernelVersion: 4.3
4+
Contact: Alexander Shishkin <[email protected]>
5+
Description: (RW) Configure MSC buffer wrapping. 1 == wrapping enabled.
6+
7+
What: /sys/bus/intel_th/devices/<intel_th_id>-msc<msc-id>/mode
8+
Date: June 2015
9+
KernelVersion: 4.3
10+
Contact: Alexander Shishkin <[email protected]>
11+
Description: (RW) Configure MSC operating mode:
12+
- "single", for contiguous buffer mode (high-order alloc);
13+
- "multi", for multiblock mode;
14+
- "ExI", for DCI handler mode;
15+
- "debug", for debug mode.
16+
If operating mode changes, existing buffer is deallocated,
17+
provided there are no active users and tracing is not enabled,
18+
otherwise the write will fail.
19+
20+
What: /sys/bus/intel_th/devices/<intel_th_id>-msc<msc-id>/nr_pages
21+
Date: June 2015
22+
KernelVersion: 4.3
23+
Contact: Alexander Shishkin <[email protected]>
24+
Description: (RW) Configure MSC buffer size for "single" or "multi" modes.
25+
In single mode, this is a single number of pages, has to be
26+
power of 2. In multiblock mode, this is a comma-separated list
27+
of numbers of pages for each window to be allocated. Number of
28+
windows is not limited.
29+
Writing to this file deallocates existing buffer (provided
30+
there are no active users and tracing is not enabled) and then
31+
allocates a new one.
32+
33+

drivers/hwtracing/intel_th/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ config INTEL_TH_STH
4444

4545
Say Y here to enable STH subdevice of Intel(R) Trace Hub.
4646

47+
config INTEL_TH_MSU
48+
tristate "Intel(R) Trace Hub Memory Storage Unit"
49+
help
50+
Memory Storage Unit (MSU) trace output device enables
51+
storing STP traces to system memory. It supports single
52+
and multiblock modes of operation and provides read()
53+
and mmap() access to the collected data.
54+
55+
Say Y here to enable MSU output device for Intel TH.
56+
4757
config INTEL_TH_DEBUG
4858
bool "Intel(R) Trace Hub debugging"
4959
depends on DEBUG_FS

drivers/hwtracing/intel_th/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ intel_th_gth-y := gth.o
1010

1111
obj-$(CONFIG_INTEL_TH_STH) += intel_th_sth.o
1212
intel_th_sth-y := sth.o
13+
14+
obj-$(CONFIG_INTEL_TH_MSU) += intel_th_msu.o
15+
intel_th_msu-y := msu.o

0 commit comments

Comments
 (0)