2017-03-26 80 views
0

基本上有兩種主要的方法來讀取ftrace日誌。 無論是從 讀/ SYS /內核/調試/跟蹤/跟蹤 或 /SYS /內核/調試/跟蹤/ trace_pipe讀如何在ftrace中設置trace_pipe的緩衝區大小?

對前緩衝器的大小可以用 /SYS /內核/調試設置/ tracing/buffer_size_kb

是否可以設置trace_pipe的緩衝區大小。如果是,如何?

回答

0

您不需要爲trace_pipe設置緩衝區大小,因爲如果沒有可用數據,它將提供實時跟蹤和塊。

瞭解更多關於(https://www.kernel.org/doc/Documentation/trace/ftrace.txt):

trace_pipe:

The output is the same as the "trace" file but this 
file is meant to be streamed with live tracing. 
Reads from this file will block until new data is 
retrieved. Unlike the "trace" file, this file is a 
consumer. This means reading from this file causes 
sequential reads to display more current data. Once 
data is read from this file, it is consumed, and 
will not be read again with a sequential read. The 
"trace" file is static, and if the tracer is not 
adding more data, it will display the same 
information every time it is read. 
+0

感謝您的答覆,但你可能沒有正確地理解我的問題。讓我再澄清一遍。我的疑問是,如果你開始從時間戳t1處的trace_pipe讀取數據,那麼它將僅從t1時間或從t1-K時間(K某個常數)給出ftrace日誌。 –

+0

你所解釋的是對於追蹤是真實的;但不適用於trace_pipe。 – rk1825