요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
설정 round-trip과 ABI 안정성
debugfs-cec-error-inj:25-40error-inj의 출력은 다시 입력할 수 있어야 하며 공통 규칙 이외의 ABI는 안정적이지 않습니다. Driver-specific commands는 CEC 문서에 최신 상태로 기록해야 합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
What: /sys/kernel/debug/cec/*/error-inj
Date: March 2018
Contact: Hans Verkuil <[email protected]>
Description:
The CEC Framework allows for CEC error injection commands through
debugfs. Drivers that support this will create an error-inj file
through which the error injection commands can be given.
The basic syntax is as follows:
Leading spaces/tabs are ignored. If the next character is a '#' or the
end of the line was reached, then the whole line is ignored. Otherwise
a command is expected.
It is up to the driver to decide what commands to implement. The only
exception is that the command 'clear' without any arguments must be
implemented and that it will remove all current error injection
commands.
This ensures that you can always do 'echo clear >error-inj' to clear any
error injections without having to know the details of the driver-specific
commands.
Note that the output of 'error-inj' shall be valid as input to 'error-inj'.
So this must work::
$ cat error-inj >einj.txt
$ cat einj.txt >error-inj
Other than these basic rules described above this ABI is not considered
stable and may change in the future.
Drivers that implement this functionality must document the commands as
part of the CEC documentation and must keep that documentation up to date
when changes are made.
The following CEC error injection implementations exist:
- Documentation/userspace-api/media/cec/cec-pin-error-inj.rst
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
CEC error injection command 규칙
1-23| 항목 | 내용 |
|---|---|
| What | /sys/kernel/debug/cec/*/error-inj |
| Date | 2018년 3월 |
| Contact | Hans 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-40error-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에 설명되어 있습니다.
공백과 주석은 건너뛰고 command를 적용한다. 현재 설정을 읽어 파일에 저장한 뒤 같은 내용을 다시 쓰면 동일한 error injection 상태를 복원할 수 있어야 한다.
Command syntax와 clear
debugfs-cec-error-inj:1-23CEC error injection을 지원하는 driver는 error-inj file을 만들며, 공백·주석 parsing과 인자 없는 clear command를 공통 규약으로 구현해야 합니다.