Documentation/trace/events-nmi.txt

来源:互联网 发布:mac 关闭照片自动打开 编辑:程序博客网 时间:2024/04/27 16:41
Chinese translated version of Documentation/trace/events-nmi.txt


If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.


Chinese maintainer: 尹娇萍  1072986620@qq.com
---------------------------------------------------------------------
Documentation/trace/events-nmi.txt 的中文翻译


如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。


中文版维护者: 尹娇萍  1072986620@qq.com
中文版翻译者: 尹娇萍  1072986620@qq.com
中文版校译者: 尹娇萍  1072986620@qq.com


以下为正文


---------------------------------------------------------------------
 
  NMI Trace Events
  
  NMI跟踪事件
   
  These events normally show up here:
  
  这些事件通常会出现在这里:
  
          /sys/kernel/debug/tracing/events/nmi
  
  --
  
  nmi_handler:
  
  NMI处理程序:
  
  You might want to use this tracepoint if you suspect that your
  NMI handlers are hogging large amounts of CPU time.  The kernel
  will warn if it sees long-running handlers:
  
          INFO: NMI handler took too long to run: 9.207 msecs
  
  and this tracepoint will allow you to drill down and get some
  more details.
  
  你可能想使用此跟踪点,如果你怀疑NMI处理程序占用大量的CPU时间。在内核
  会发出警告,如果它看到长期运行的处理程序:


          INFO:NMI处理程序运行时间太长:9.207毫秒


  这个跟踪点可以让你进一步跟踪,并得到一些更多详情。
  
  
  Let's say you suspect that perf_event_nmi_handler() is causing
  you some problems and you only want to trace that handler
  specifically.  You need to find its address:
  
          $ grep perf_event_nmi_handler /proc/kallsyms
          ffffffff81625600 t perf_event_nmi_handler
 
  比方说,你怀疑perf_event_nmi_handler()是给你造成一些问题的原因,而你
  只想追查具体处理程序。那么你需要找到它的地址:
  
          $ grep perf_event_nmi_handler /proc/kallsyms
          ffffffff81625600 t perf_event_nmi_handler
  
  Let's also say you are only interested in when that function is
  really hogging a lot of CPU time, like a millisecond at a time.
  Note that the kernel's output is in milliseconds, but the input
  to the filter is in nanoseconds!  You can filter on 'delta_ns':
  
  cd /sys/kernel/debug/tracing/events/nmi/nmi_handler
  echo 'handler==0xffffffff81625600 && delta_ns>1000000' > filter
  echo 1 > enable
  
  让我们也说,你只是有兴趣当该功能真的是占用了大量的CPU时间,像一个毫秒一次。
  需要注意的是内核的输出(以毫秒为单位),但输入到滤波器是在纳秒!
  您可以过滤“delta_ns”:
  
  cd /sys/kernel/debug/tracing/events/nmi/nmi_handler
  echo 'handler==0xffffffff81625600 && delta_ns>1000000' > filter
  echo 1 > enable
  
  Your output would then look like:
  
  您需要输入以下命令:
  
  $ cat /sys/kernel/debug/tracing/trace_pipe
  <idle>-0     [000] d.h3   505.397558: nmi_handler: perf_event_nmi_handler() delta_ns: 3236765 handled: 1
  <idle>-0     [000] d.h3   505.805893: nmi_handler: perf_event_nmi_handler() delta_ns: 3174234 handled: 1
  <idle>-0     [000] d.h3   506.158206: nmi_handler: perf_event_nmi_handler() delta_ns: 3084642 handled: 1
  <idle>-0     [000] d.h3   506.334346: nmi_handler: perf_event_nmi_handler() delta_ns: 3080351 handled: 1
原创粉丝点击