← Documents Documentation/trace/sys-t.rst GitHub 원문 ↗

Linux 6.18.37 · Tracing

STP를 통한 MIPI SyS-T

STM에서 MIPI SyS-T protocol을 선택하고 UUID, payload length, protocol timestamp와 CLOCKSYNC 간격을 configfs policy node에 설정하는 방법을 설명합니다.

Source pathDocumentation/trace/sys-t.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

sys-t.rst:1-62

SyS-T는 STM/STP trace에 표준 source 식별과 timestamp correlation을 추가합니다. policy 이름에서 `p_sys-t`를 선택하고 node별 protocol 속성으로 출력 형식을 조정합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ===================
4 MIPI SyS-T over STP
5 ===================
6
7 The MIPI SyS-T protocol driver can be used with STM class devices to
8 generate standardized trace stream. Aside from being a standard, it
9 provides better trace source identification and timestamp correlation.
10
11 In order to use the MIPI SyS-T protocol driver with your STM device,
12 first, you'll need CONFIG_STM_PROTO_SYS_T.
13
14 Now, you can select which protocol driver you want to use when you create
15 a policy for your STM device, by specifying it in the policy name:
16
17 # mkdir /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/
18
19 In other words, the policy name format is extended like this:
20
21 <device_name>:<protocol_name>.<policy_name>
22
23 With Intel TH, therefore it can look like "0-sth:p_sys-t.my-policy".
24
25 If the protocol name is omitted, the STM class will chose whichever
26 protocol driver was loaded first.
27
28 You can also double check that everything is working as expected by
29
30 # cat /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/protocol
31 p_sys-t
32
33 Now, with the MIPI SyS-T protocol driver, each policy node in the
34 configfs gets a few additional attributes, which determine per-source
35 parameters specific to the protocol:
36
37 # mkdir /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/default
38 # ls /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/default
39 channels
40 clocksync_interval
41 do_len
42 masters
43 ts_interval
44 uuid
45
46 The most important one here is the "uuid", which determines the UUID
47 that will be used to tag all data coming from this source. It is
48 automatically generated when a new node is created, but it is likely
49 that you would want to change it.
50
51 do_len switches on/off the additional "payload length" field in the
52 MIPI SyS-T message header. It is off by default as the STP already
53 marks message boundaries.
54
55 ts_interval and clocksync_interval determine how much time in milliseconds
56 can pass before we need to include a protocol (not transport, aka STP)
57 timestamp in a message header or send a CLOCKSYNC packet, respectively.
58
59 See Documentation/ABI/testing/configfs-stp-policy-p_sys-t for more
60 details.
61
62 * [1] https://www.mipi.org/specifications/sys-t
63

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

MIPI SyS-T protocol 준비

1-13

이 문서는 GPL-2.0 라이선스를 따릅니다. MIPI SyS-T protocol driver는 STM class device와 함께 사용하여 표준화된 trace stream을 생성할 수 있습니다.

SyS-T는 표준이라는 장점 외에도 trace source 식별을 더 명확하게 하고 서로 다른 timestamp의 상관관계를 맞추기 쉽게 합니다.

STM device에서 MIPI SyS-T protocol driver를 사용하려면 kernel 구성에서 `CONFIG_STM_PROTO_SYS_T`를 활성화해야 합니다.

SyS-T trace 구성
Trace sourceMIPI SyS-T protocol
STM class deviceSTP transport
Decodersource ID + correlated timestamps

STM class 위에서 SyS-T protocol driver가 source 식별과 timestamp correlation을 포함한 표준 stream을 만듭니다.

.. SPDX-License-Identifier: GPL-2.0

===================
MIPI SyS-T over STP
===================

The MIPI SyS-T protocol driver can be used with STM class devices to
generate standardized trace stream. Aside from being a standard, it
provides better trace source identification and timestamp correlation.

In order to use the MIPI SyS-T protocol driver with your STM device,
first, you'll need CONFIG_STM_PROTO_SYS_T.

policy 이름으로 protocol 선택

14-32

STM device의 policy를 만들 때 policy 이름에 protocol을 지정하여 사용할 protocol driver를 선택할 수 있습니다.

# mkdir /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/

확장된 policy 이름 형식은 `<device_name>:<protocol_name>.<policy_name>`입니다. Intel TH에서는 `0-sth:p_sys-t.my-policy`와 같은 이름을 사용할 수 있습니다.

protocol 이름을 생략하면 STM class는 먼저 load된 protocol driver를 선택합니다. 선택 결과는 policy directory의 `protocol` attribute를 읽어 다시 확인할 수 있습니다.

# cat /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/protocol
p_sys-t
SyS-T policy 이름
구성 요소
device_namedummy_stm.0 또는 0-sth
protocol_namep_sys-t
policy_namemy-policy
전체 형식<device_name>:<protocol_name>.<policy_name>

device, protocol, policy 식별자가 하나의 configfs directory 이름을 이룹니다.

protocol 선택과 확인
mkdir policyparse protocol_name
p_sys-t driverattach to policy
read protocol attributep_sys-t

policy 생성 시 지정한 protocol이 해당 STM policy에 연결됩니다.

Now, you can select which protocol driver you want to use when you create
a policy for your STM device, by specifying it in the policy name:

# mkdir /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/

In other words, the policy name format is extended like this:

  <device_name>:<protocol_name>.<policy_name>

With Intel TH, therefore it can look like "0-sth:p_sys-t.my-policy".

If the protocol name is omitted, the STM class will chose whichever
protocol driver was loaded first.

You can also double check that everything is working as expected by

# cat /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/protocol
p_sys-t

SyS-T policy node 속성과 UUID

33-49

MIPI SyS-T protocol driver를 사용하면 configfs의 각 policy node에 source별 protocol parameter를 정하는 추가 attribute가 생깁니다.

# mkdir /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/default
# ls /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/default
channels
clocksync_interval
do_len
masters
ts_interval
uuid

가장 중요한 속성은 `uuid`입니다. 이 source에서 오는 모든 data를 표시할 UUID를 결정합니다. 새 node를 만들면 자동 생성되지만 실제 구성에 맞는 값으로 바꾸고 싶을 가능성이 큽니다.

SyS-T node attributes
속성역할
masters / channelssource에 할당할 STP 자원 범위
uuidsource의 모든 data를 식별하는 UUID
do_lenmessage header의 payload length field 사용 여부
ts_intervalprotocol timestamp 삽입 최대 간격(ms)
clocksync_intervalCLOCKSYNC packet 전송 최대 간격(ms)

기존 master/channel 범위에 SyS-T 고유 source parameter가 추가됩니다.

Now, with the MIPI SyS-T protocol driver, each policy node in the
configfs gets a few additional attributes, which determine per-source
parameters specific to the protocol:

# mkdir /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/default
# ls /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/default
channels
clocksync_interval
do_len
masters
ts_interval
uuid

The most important one here is the "uuid", which determines the UUID
that will be used to tag all data coming from this source. It is
automatically generated when a new node is created, but it is likely
that you would want to change it.

길이 필드와 timestamp 간격

50-62

`do_len`은 MIPI SyS-T message header의 추가 `payload length` field를 켜거나 끕니다. STP 자체가 이미 message 경계를 표시하므로 기본값은 off입니다.

`ts_interval`은 message header에 transport timestamp가 아닌 protocol timestamp를 다시 포함하기 전까지 허용할 최대 시간을 millisecond 단위로 정합니다.

`clocksync_interval`은 CLOCKSYNC packet을 다시 보내기 전까지 허용할 최대 시간을 millisecond 단위로 정합니다. 두 interval은 각각 message timestamp와 clock 동기화 packet의 주기를 제어합니다.

더 자세한 ABI는 `Documentation/ABI/testing/configfs-stp-policy-p_sys-t`에서 확인할 수 있으며, 참고문헌 [1]은 MIPI SyS-T specification URL입니다.

SyS-T 시간 정보 제어
ts_interval elapsedinclude protocol timestamp in header
clocksync_interval elapsedsend CLOCKSYNC packet
STP transportalready marks message boundaries

두 interval이 서로 다른 시간 정보의 최대 생략 기간을 제어합니다.


do_len switches on/off the additional "payload length" field in the
MIPI SyS-T message header. It is off by default as the STP already
marks message boundaries.

ts_interval and clocksync_interval determine how much time in milliseconds
can pass before we need to include a protocol (not transport, aka STP)
timestamp in a message header or send a CLOCKSYNC packet, respectively.

See Documentation/ABI/testing/configfs-stp-policy-p_sys-t for more
details.

* [1] https://www.mipi.org/specifications/sys-t