mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
perf probe: Allow placing uprobes in alternate namespaces.
Teaches perf how to place a uprobe on a file that's in a different mount namespace. The user must add the probe using the --target-ns argument to perf probe. Once it has been placed, it may be recorded against without further namespace-specific commands. Signed-off-by: Krister Johansen <kjlx@templeofstupid.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Brendan Gregg <brendan.d.gregg@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> [ PPC build fixed by Ravi: ] Link: http://lkml.kernel.org/r/1500287542-6219-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com> [ Fix !HAVE_DWARF_SUPPORT build ] Link: http://lkml.kernel.org/r/1499305693-1599-4-git-send-email-kjlx@templeofstupid.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
bf2e710b3c
commit
544abd44c7
7 changed files with 125 additions and 34 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "event.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <limits.h>
|
||||
#include <sched.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
@ -233,3 +234,15 @@ void nsinfo__mountns_exit(struct nscookie *nc)
|
|||
nc->newns = -1;
|
||||
}
|
||||
}
|
||||
|
||||
char *nsinfo__realpath(const char *path, struct nsinfo *nsi)
|
||||
{
|
||||
char *rpath;
|
||||
struct nscookie nsc;
|
||||
|
||||
nsinfo__mountns_enter(nsi, &nsc);
|
||||
rpath = realpath(path, NULL);
|
||||
nsinfo__mountns_exit(&nsc);
|
||||
|
||||
return rpath;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue