History

stm class: Introduce an abstraction for System Trace Module devices

A System Trace Module (STM) is a device exporting data in System Trace Protocol (STP) format as defined by MIPI STP standards. Examples of such devices are Intel(R) Trace Hub and Coresight STM. This abstraction provides a unified interface for software trace sources to send their data over an STM device to a debug host. In order to do that, such a trace source needs to be assigned a pair of master/channel identifiers that all the data from this source will be tagged with. The STP decoder on the debug host side will use these master/channel tags to distinguish different trace streams from one another inside one STP stream. This abstraction provides a configfs-based policy management mechanism for dynamic allocation of these master/channel pairs based on trace source-supplied string identifier. It has the flexibility of being defined at runtime and at the same time (provided that the policy definition is aligned with the decoding end) consistency. For userspace trace sources, this abstraction provides write()-based and mmap()-based (if the underlying stm device allows this) output mechanism. For kernel-side trace sources, we provide "stm_source" device class that can be connected to an stm device at run time.

Alexander Shishkin committed 11 years ago

Commit 7bd1d401 parent 9b7696814 files · +1991 −0Browse files

Showing the changes to include/uapi (1 of 14 files). Show all

Unified · Split

include/uapi/linux/stm.h+50−0
@@ -0,0 +1,50 @@
1/*
2 * System Trace Module (STM) userspace interfaces
3 * Copyright (c) 2014, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * STM class implements generic infrastructure for System Trace Module devices
15 * as defined in MIPI STPv2 specification.
16 */
17
18#ifndef _UAPI_LINUX_STM_H
19#define _UAPI_LINUX_STM_H
20
21#include <linux/types.h>
22
23/**
24 * struct stp_policy_id - identification for the STP policy
25 * @size: size of the structure including real id[] length
26 * @master: assigned master
27 * @channel: first assigned channel
28 * @width: number of requested channels
29 * @id: identification string
30 *
31 * User must calculate the total size of the structure and put it into
32 * @size field, fill out the @id and desired @width. In return, kernel
33 * fills out @master, @channel and @width.
34 */
35struct stp_policy_id {
36 __u32 size;
37 __u16 master;
38 __u16 channel;
39 __u16 width;
40 /* padding */
41 __u16 __reserved_0;
42 __u32 __reserved_1;
43 char id[0];
44};
45
46#define STP_POLICY_ID_SET _IOWR('%', 0, struct stp_policy_id)
47#define STP_POLICY_ID_GET _IOR('%', 1, struct stp_policy_id)
48#define STP_SET_OPTIONS _IOW('%', 2, __u64)
49
50#endif /* _UAPI_LINUX_STM_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t