Vietnamese (machine translation)

Lưu ý

Mục đích của file này là để độc giả tiếng Việt có thể đọc và hiểu tài liệu nhân kernel dễ dàng hơn, không phải để tạo ra một nhánh tài liệu riêng. Nếu bạn có bất kỳ nhận xét hoặc cập nhật nào cho file này, vui lòng thử cập nhật file tiếng Anh gốc trước. Nếu bạn thấy có sự khác biệt giữa bản dịch và bản gốc, hoặc có vấn đề về bản dịch, vui lòng gửi góp ý hoặc patch cho người dịch của file này, hoặc nhờ người bảo trì và người review tài liệu tiếng Việt giúp đỡ.

Bản gốc:

rtla-hwnoise

Người dịch:

Google Translate (machine translation)

Phiên bản gốc:

8541d8f725c6

Cảnh báo

Tài liệu này được dịch tự động bằng máy và chưa được review bởi người dịch. Nội dung có thể không chính xác hoặc khó hiểu ở một số chỗ. Khi có sự khác biệt với bản gốc, bản gốc luôn là chuẩn. Bản dịch chất lượng cao (được review) được đặt trong thư mục vi_VN/.

rtla-hwnoise

Phát hiện và định lượng tiếng ồn liên quan đến phần cứng

Phần hướng dẫn sử dụng:

1

SYNOPSIS

ZZ0000ZZ [ZZ0001ZZ]

DESCRIPTION

ZZ0000ZZ thu thập bản tóm tắt định kỳ từ công cụ theo dõi ZZ0001ZZ chạy với ZZ0002ZZ. Bằng cách vô hiệu hóa các ngắt và lập kế hoạch do đó, trong số các luồng, chỉ có các ngắt không thể che dấu và các ngắt liên quan đến phần cứng tiếng ồn được cho phép.

Công cụ này cũng cho phép cấu hình bộ theo dõi ZZ0000ZZ và bộ sưu tập đầu ra của bộ theo dõi.

OPTIONS

-a, --auto us

Set the automatic trace mode. This mode sets some commonly used options while debugging the system. It is equivalent to use -s us -T 1 -t.

-p, --period us

Set the osnoise tracer period in microseconds.

-r, --runtime us

Set the osnoise tracer runtime in microseconds.

-s, --stop us

Stop the trace if a single sample is higher than the argument in microseconds. If -T is set, it will also save the trace to the output.

-S, --stop-total us

Stop the trace if the total sample is higher than the argument in microseconds. If -T is set, it will also save the trace to the output.

-T, --threshold us

Specify the minimum delta between two time reads to be considered noise. The default threshold is 5 us.

-t, --trace [file]

Save the stopped trace to [file|osnoise_trace.txt].

-q, --quiet

Print only a summary at the end of the session.

-c, --cpus cpu-list

Set the hwnoise tracer to run the sample threads in the cpu-list.

By default, the hwnoise tracer runs the sample threads on all CPUs.

-H, --house-keeping cpu-list

Run rtla control threads only on the given cpu-list.

If omitted, rtla will attempt to auto-migrate its main thread to any CPU that is not running any workload threads.

-d, --duration time[s|m|h|d]

Set the duration of the session.

-D, --debug

Print debug info.

-e, --event sys:event

Enable an event in the trace (-t) session. The argument can be a specific event, e.g., -e sched:sched_switch, or all events of a system group, e.g., -e sched. Multiple -e are allowed. It is only active when -t or -a are set.

--filter <filter>

Filter the previous -e sys:event event with <filter>. For further information about event filtering see https://www.kernel.org/doc/html/latest/trace/events.html#event-filtering.

--trigger <trigger>

Enable a trace event trigger to the previous -e sys:event. If the hist: trigger is activated, the output histogram will be automatically saved to a file named system_event_hist.txt. For example, the command:

rtla <command> <mode> -t -e osnoise:irq_noise --trigger=”hist:key=desc,duration/1000:sort=desc,duration/1000:vals=hitcount”

Will automatically save the content of the histogram associated to osnoise:irq_noise event in osnoise_irq_noise_hist.txt.

For further information about event trigger see https://www.kernel.org/doc/html/latest/trace/events.html#event-triggers.

-P, --priority o:prio|r:prio|f:prio|d:runtime:period

Set scheduling parameters to the hwnoise tracer threads, the format to set the priority are:

  • o:prio - use SCHED_OTHER with prio;

  • r:prio - use SCHED_RR with prio;

  • f:prio - use SCHED_FIFO with prio;

  • d:runtime[us|ms|s]:period[us|ms|s] - use SCHED_DEADLINE with runtime and period in nanoseconds.

If not set, tracer threads keep their default priority. For rtla user threads, it is set to SCHED_FIFO with priority 95. For kernel threads, see osnoise and timerlat tracer documentation for the running kernel version.

-C, --cgroup [cgroup]

Set a cgroup to the tracer’s threads. If the -C option is passed without arguments, the tracer’s thread will inherit rtla’s cgroup. Otherwise, the threads will be placed on the cgroup passed to the option.

If not set, the behavior differs between workload types. User workloads created by rtla will inherit rtla’s cgroup. Kernel workloads are assigned the root cgroup.

--warm-up s

After starting the workload, let it run for s seconds before starting collecting the data, allowing the system to warm-up. Statistical data generated during warm-up is discarded.

--trace-buffer-size kB

Set the per-cpu trace buffer size in kB for the tracing output.

If not set, the default tracefs buffer size is used.

--on-threshold action

Defines an action to be executed when tracing is stopped on a latency threshold specified by -a/--auto, -s/--stop, or -S/--stop-total.

Multiple --on-threshold actions may be specified, and they will be executed in the order they are provided. If any action fails, subsequent actions in the list will not be executed.

Supported actions are:

  • trace[,file=<filename>]

    Saves trace output, optionally taking a filename. Alternative to -t/--trace. Note that unlike -t/--trace, specifying this multiple times will result in the trace being saved multiple times.

  • signal,num=<sig>,pid=<pid>

    Sends signal to process. “parent” might be specified in place of pid to target the parent process of rtla.

  • shell,command=<command>

    Execute shell command.

  • continue

    Continue tracing after actions are executed instead of stopping.

Example:

$ rtla hwnoise -s 20 --on-threshold trace --on-threshold shell,command=”grep ipi_send osnoise_trace.txt” --on-threshold signal,num=2,pid=parent

This will save a trace with the default filename “osnoise_trace.txt”, print its lines that contain the text “ipi_send” on standard output, and send signal 2 (SIGINT) to the parent process.

Performance Considerations:

Due to implementational limitations, actions might be delayed up to one second after tracing is stopped.

--on-end action

Defines an action to be executed at the end of tracing.

Multiple --on-end actions can be specified, and they will be executed in the order they are provided. If any action fails, subsequent actions in the list will not be executed.

See the documentation for --on-threshold for the list of supported actions, with the exception that continue has no effect.

Example:

$ rtla hwnoise -d 5s --on-end trace

This runs rtla with the default options, and saves trace output at the end.

-h, --help

Print help menu.

EXAMPLE

Trong ví dụ bên dưới, công cụ ZZ0000ZZ được thiết lập để chạy trên CPU ZZ0001ZZ trên hệ thống có 8 lõi/16 luồng có bật tính năng siêu phân luồng.

Công cụ này được thiết lập để phát hiện bất kỳ tiếng ồn nào cao hơn ZZ0000ZZ, để chạy cho ZZ0001ZZ, hiển thị bản tóm tắt báo cáo tại kết thúc phiên:

# rtla hwnoise -c 1-7 -T 1 -d 10m -q

Tiếng ồn liên quan đến phần cứng

thời lượng: 0 00:10:00 | thời gian ở trong chúng ta CPU Tiếng ồn thời gian chạy % CPU Tiếng ồn tối đa aval Tối đa đơn HW NMI

1 #599 599000000 138 99.99997 3 3 4 74 2 #599 599000000 85 99.99998 3 3 4 75 3 #599 599000000 86 99.99998 4 3 6 75 4 #599 599000000 81 99.99998 4 4 2 75 5 #599 599000000 85 99.99998 2 2 2 75 6 #599 599000000 76 99.99998 2 2 0 75 7 #599 599000000 77 99.99998 3 3 0 75

Cột đầu tiên hiển thị ZZ0000ZZ và cột thứ hai hiển thị số lượng ZZ0001ZZ công cụ này đã chạy trong phiên. ZZ0002ZZ là thời gian công cụ này chạy hiệu quả trên CPU. Cột ZZ0003ZZ là tổng của tất cả tiếng ồn mà công cụ quan sát được và ZZ0004ZZ là mối quan hệ giữa ZZ0005ZZ và ZZ0006ZZ.

Cột ZZ0000ZZ là mức nhiễu phần cứng tối đa mà công cụ phát hiện được trong một khoảng thời gian và ZZ0001ZZ là tiếng ồn đơn lớn nhất được nhìn thấy.

Cột ZZ0000ZZ và ZZ0001ZZ hiển thị tổng số nhiễu ZZ0002ZZ và ZZ0003ZZ sự xuất hiện được quan sát bởi công cụ.

Ví dụ: ZZ0000ZZ chạy các giai đoạn ZZ0001ZZ của ZZ0002ZZ. CPU đã nhận được ZZ0003ZZ có tiếng ồn trong toàn bộ quá trình thực hiện, để lại ZZ0004ZZ trong thời gian CPU cho ứng dụng. Trong giai đoạn tồi tệ nhất, CPU đã khiến ZZ0005ZZ bị tiếng ồn cho ứng dụng, nhưng chắc chắn nó được gây ra bởi nhiều hơn một tiếng ồn, vì tiếng ồn của ZZ0006ZZ là của ZZ0007ZZ. CPU có ZZ0008ZZ ở mức tỷ lệ ZZ0009ZZ/ZZ0010ZZ. CPU cũng có ZZ0011ZZ, ở mức cao hơn tần số: khoảng ZZ0012ZZ.

Công cụ sẽ báo cáo tiếng ồn liên quan đến phần cứng ZZ0001ZZ trong tình huống lý tưởng. Ví dụ: bằng cách tắt tính năng siêu phân luồng để loại bỏ nhiễu phần cứng, và vô hiệu hóa cơ quan giám sát TSC để loại bỏ NMI (có thể xác định này bằng cách sử dụng các tùy chọn theo dõi của ZZ0000ZZ), có thể tiếp cận tình huống lý tưởng trong cùng một phần cứng:

# rtla hwnoise -c 1-7 -T 1 -d 10m -q

Tiếng ồn liên quan đến phần cứng

thời lượng: 0 00:10:00 | thời gian ở trong chúng ta CPU Tiếng ồn thời gian chạy % CPU Tiếng ồn tối đa aval Tối đa đơn HW NMI

1 #599 599000000 0 100.00000 0 0 0 0 2 #599 599000000 0 100.00000 0 0 0 0 3 #599 599000000 0 100.00000 0 0 0 0 4 #599 599000000 0 100.00000 0 0 0 0 5 #599 599000000 0 100.00000 0 0 0 0 6 #599 599000000 0 100.00000 0 0 0 0 7 #599 599000000 0 100.00000 0 0 0 0

SEE ALSO

ZZ0000ZZ(1)

ZZ0000ZZ

AUTHOR

Viết bởi Daniel Bristot de Oliveira <bristot@kernel.org>

SIGINT BEHAVIOR

On the first SIGINT, RTLA exits after collecting all outstanding samples up to the point of receiving the signal.

When receiving more than one SIGINT, RTLA discards any outstanding samples, and exits while displaying only samples that have already been processed.

If SIGINT is received during RTLA cleanup, RTLA exits immediately via the default signal handler.

Note: For the purpose of SIGINT behavior, the expiry of duration specified via the -d/--duration option is treated as equivalent to receiving a SIGINT. For example, a SIGINT received after duration expired but samples have not been processed yet will drop any outstanding samples.

Also note that when using the timerlat tool in BPF mode, samples are processed in-kernel; RTLA only copies them out to display them to the user. A second SIGINT does not affect in-kernel sample aggregation.

EXIT STATUS

0  Passed: the test did not hit the stop tracing condition
1  Error: invalid argument
2  Failed: the test hit the stop tracing condition

REPORTING BUGS

Report bugs to <linux-kernel@vger.kernel.org> and <linux-trace-devel@vger.kernel.org>

LICENSE

rtla is Free Software licensed under the GNU GPLv2

COPYING

Copyright (C) 2021 Red Hat, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL).