Re: [PATCH] tracing/lockdep: turn lock->name into an array



Hi

Impact: allow filtering by lock name / fix module tracing

Currently, the "lock acquired" event is traced using a TRACE_EVENT.
But we can't use the char * type for the name without risking to
dereference a freed pointer. A lock name can come from a module
towards lockdep and it is risky to only store its address because we
defer its name printing.

When released lockdep string table?
I guess it only happend at module unloading. if so, we should consider to
make delayed string table freeing at module unloading.

My point is, module unloading is rare event. thus meking pointer safe mechanism
widely avoid string copy.

IOW, if not, ringbuffer is filled tons string. it kill the merit of binary
buffer and current design.


That's why this patch uses a fixed array size and copy the name.
Also it lets us filter the lock name because the event filtering
doesn't handle the char pointers. Such support is not needed yet since
the events don't use it for now because it is rarely easy to keep track
of a string while we defer its output.

Signed-off-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>



--
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] tracing/lockdep: turn lock->name into an array
    ... dereference a freed pointer. ... When released lockdep string table? ... table freeing at module unloading. ... module unloading is rare event. ...
    (Linux-Kernel)
  • Re: [PATCH] tracing/lockdep: turn lock->name into an array
    ... dereference a freed pointer. ... When released lockdep string table? ... table freeing at module unloading. ... module unloading is rare event. ...
    (Linux-Kernel)
  • Re: Thread Locking In Static Methods - How?
    ... the lock keyword is a terribly named keyword ... Because you use a string literal, anyone else locking the same string literal will be in contention with you as the string is interned ... What this does is cause a lock of any code location that uses the ...
    (microsoft.public.dotnet.languages.csharp)
  • IM Lock 2006 - Insecure Registry Permission Vulnerability
    ... IM Lock 2006 discloses passwords to local users. ... (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) ... Dim GetCrypt, Decrypt As String ... Dim lResult As Long ...
    (Bugtraq)
  • Re: Floyd Rose tuning stability
    ... No string lubricants or anything like that. ... If you're able to test the pitch of the string section between the locking ... screws coming out the back that lock the strings in, ... Strat-style whammy bar. ...
    (alt.guitar)