Re: [PATCH] ftrace: Don't use tracing_record_cmdline() in workqueue tracer




* KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> wrote:


* KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> wrote:

Currently, /sys/kernel/debug/tracing/trace_stat/workqueues can
display wrong and strang thread name.

Why?

Currently, ftrace has
tracing_record_cmdline()/trace_find_cmdline() convinience
function. they implement task->comm string cache. it can avoid
unnecessary memcpy overhead. and workqueue tracer use it.

However, in general, any trace stastics feature shouldn't use
tracing_record_cmdline(). A trace stastics can display very
old process. then comm cache can return wrong string because
recent process override the cache.

Fortunately, workqueue trace gerantee to live displayed
process. Then, we can search comm string from pid at display
time.

Applied, thanks!

We might need to improve the comm-cache - i've seen frequent
artifacts due to it. Displaying <...> is _far_ better than an
outright misleading string displayed.

I.e. the cache should be improved to be properly coherent with
reality.

Ingo

Doh!
My last mail's cc list didn't include lkml. that's unintensional silly
my mistake. very sorry.

and Yes, memcpy(buf, task->comm, 16) mean two movq
instruction. that is worthless for caching. I think we can
remove this cache completely.

ok, agreed - mind sending a patch for that?

and, I find my last patch has one race window. fixing below.

Could you please send a delta patch against tip:master? Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH] ftrace: Dont use tracing_record_cmdline() in workqueue tracer
    ... display wrong and strang thread name. ... they implement task->comm string cache. ... Subject: tracing: Don't use tracing_record_cmdlinein workqueue tracer fix ...
    (Linux-Kernel)
  • Re: A Simple BMP Converter
    ... "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal ... Private Sub cmdSysInfo_Click ... Open Registry Key ... > color bar in the color display. ...
    (comp.lang.basic.visual.misc)
  • Re: help collecting data.
    ... Dim GetC As String ... the code in the cell that I want the order numbers(info from column C ... "Otto Moehrbach" wrote: ... display them both, seperated by a comma ...
    (microsoft.public.excel.misc)
  • Code Addendum 01 - gforth: OpenGL Graphics Lesson 12
    ... \ These specify the size/depth of the SDL display surface ... \ Most SDL and OpenGL functions that require string data also require ... \ OpenGL scene generation code functions. ...
    (comp.lang.forth)
  • Re: Output data from multiple records in a table
    ... > Dim rsR As DAO.Recordset ... > Dim strSQL As String ... > such as display it in a textbox on your form. ...
    (microsoft.public.access.modulesdaovba)