← Documents Documentation/ABI/testing/debugfs-cec-error-inj GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

CEC error injection debugfs ABI

CEC Framework error-inj debugfs file의 command parsing, 필수 clear command, 현재 설정의 출력·복원 규약과 driver-specific command 문서화 의무를 설명합니다.

Source pathDocumentation/ABI/testing/debugfs-cec-error-inj
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

Command syntax와 clear

debugfs-cec-error-inj:1-23

CEC error injection을 지원하는 driver는 error-inj file을 만들며, 공백·주석 parsing과 인자 없는 clear command를 공통 규약으로 구현해야 합니다.

설정 round-trip과 ABI 안정성

debugfs-cec-error-inj:25-40

error-inj의 출력은 다시 입력할 수 있어야 하며 공통 규칙 이외의 ABI는 안정적이지 않습니다. Driver-specific commands는 CEC 문서에 최신 상태로 기록해야 합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/kernel/debug/cec/*/error-inj
2 Date: March 2018
3 Contact: Hans Verkuil <[email protected]>
4 Description:
5
6 The CEC Framework allows for CEC error injection commands through
7 debugfs. Drivers that support this will create an error-inj file
8 through which the error injection commands can be given.
9
10 The basic syntax is as follows:
11
12 Leading spaces/tabs are ignored. If the next character is a '#' or the
13 end of the line was reached, then the whole line is ignored. Otherwise
14 a command is expected.
15
16 It is up to the driver to decide what commands to implement. The only
17 exception is that the command 'clear' without any arguments must be
18 implemented and that it will remove all current error injection
19 commands.
20
21 This ensures that you can always do 'echo clear >error-inj' to clear any
22 error injections without having to know the details of the driver-specific
23 commands.
24
25 Note that the output of 'error-inj' shall be valid as input to 'error-inj'.
26 So this must work::
27
28 $ cat error-inj >einj.txt
29 $ cat einj.txt >error-inj
30
31 Other than these basic rules described above this ABI is not considered
32 stable and may change in the future.
33
34 Drivers that implement this functionality must document the commands as
35 part of the CEC documentation and must keep that documentation up to date
36 when changes are made.
37
38 The following CEC error injection implementations exist:
39
40 - Documentation/userspace-api/media/cec/cec-pin-error-inj.rst
41

3. 한국어 전문 번역

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

CEC error injection command 규칙

1-23
항목내용
What/sys/kernel/debug/cec/*/error-inj
Date2018년 3월
ContactHans Verkuil <[email protected]>

CEC Framework는 debugfs를 통해 CEC error injection commands를 허용합니다. 이를 지원하는 drivers는 error-inj file을 만들고, 사용자는 이 file에 error injection commands를 전달할 수 있습니다.

기본 문법은 다음과 같습니다.

입력 상태처리
줄 앞의 space 또는 tab무시하고 다음 문자를 확인합니다.
다음 문자가 #해당 줄 전체를 무시합니다.
줄 끝에 도달해당 줄 전체를 무시합니다.
그 밖의 문자Command가 시작되는 것으로 처리합니다.

어떤 commands를 구현할지는 driver가 결정합니다. 단 하나의 예외로, 인자가 없는 clear command는 반드시 구현해야 하며 현재 등록된 모든 error injection commands를 제거해야 합니다.

echo clear >error-inj

따라서 driver-specific command의 세부 내용을 몰라도 위 명령으로 모든 error injections를 언제든 지울 수 있습니다.

설정 저장·복원과 안정성 범위

25-40

error-inj의 출력은 error-inj에 유효한 입력이어야 합니다. 따라서 다음 저장·복원 sequence가 동작해야 합니다.

$ cat error-inj >einj.txt
$ cat einj.txt >error-inj

앞에서 설명한 기본 규칙을 제외하면 이 ABI는 안정적인 것으로 간주하지 않으며 이후 변경될 수 있습니다.

이 기능을 구현하는 drivers는 CEC documentation의 일부로 commands를 문서화해야 하고, 변경 사항이 생기면 해당 문서를 최신 상태로 유지해야 합니다.

현재 존재하는 CEC error injection 구현은 Documentation/userspace-api/media/cec/cec-pin-error-inj.rst에 설명되어 있습니다.

error-inj parsing과 설정 round-trip
Input lineLeading whitespace 제거# 또는 EOL줄 무시
Input lineCommand parseDriver-specific injection state
clear모든 injection command 제거Empty state
cat error-injeinj.txtwrite to error-injState 복원

공백과 주석은 건너뛰고 command를 적용한다. 현재 설정을 읽어 파일에 저장한 뒤 같은 내용을 다시 쓰면 동일한 error injection 상태를 복원할 수 있어야 한다.