Patch "perf namespaces: Introduce nsinfo__set_in_pidns()" has been added to the 6.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf namespaces: Introduce nsinfo__set_in_pidns()

to the 6.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-namespaces-introduce-nsinfo__set_in_pidns.patch
and it can be found in the queue-6.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 936d7954a24d77fa7bc8537ac0b2dcd31820914d
Author: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Date:   Fri Dec 6 17:48:26 2024 -0300

    perf namespaces: Introduce nsinfo__set_in_pidns()
    
    [ Upstream commit 9c6a585d257f6845731f4e36b45fe42b5c3162f5 ]
    
    When we're processing a perf.data file we will, for every thread in that
    file do a machine__findnew_thread(machine, pid, tid) that when that pid
    is seen for the first time will create a 'struct thread' representing
    it.
    
    That in turn will call nsinfo__new() -> nsinfo__init() and there it will
    assume we're running live, which is wrong and will need to be addressed
    in a followup patch.
    
    The nsinfo__new() assumes that if we can't access that thread it has
    already finished and will ignore the -1 return from nsinfo__init(), just
    taking notes to avoid trying to enter in that namespace, since it isn't
    there anymore, a race.
    
    When doing this from 'perf inject', tho, we can fill in parts of that
    nsinfo from what we get from the PERF_RECORD_MMAP2 (pid, tid) and in the
    jitdump file name, that has the form of jit-<PID>.dump.
    
    So if the pid in the jitdump file name is not the one in the
    PERF_RECORD_MMAP2, we can assume that its the pid of the process
    _inside_ the namespace, and that perf was runing outside that namespace.
    
    This will be done in the following patch.
    
    Reported-by: Francesco Nigro <fnigro@xxxxxxxxxx>
    Reported-by: Ilan Green <igreen@xxxxxxxxxx>
    Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
    Cc: Clark Williams <williams@xxxxxxxxxx>
    Cc: Ian Rogers <irogers@xxxxxxxxxx>
    Cc: Ingo Molnar <mingo@xxxxxxxxxx>
    Cc: James Clark <james.clark@xxxxxxxxxx>
    Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Cc: Stephane Eranian <eranian@xxxxxxxxxx>
    Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
    Cc: Yonatan Goldschmidt <yonatan.goldschmidt@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20241206204828.507527-4-acme@xxxxxxxxxx
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Stable-dep-of: 64a7617efd5a ("perf namespaces: Fixup the nsinfo__in_pidns() return type, its bool")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/util/namespaces.c b/tools/perf/util/namespaces.c
index cb185c5659d6b..36047184d76e2 100644
--- a/tools/perf/util/namespaces.c
+++ b/tools/perf/util/namespaces.c
@@ -271,6 +271,11 @@ pid_t nsinfo__in_pidns(const struct nsinfo  *nsi)
 	return RC_CHK_ACCESS(nsi)->in_pidns;
 }
 
+void nsinfo__set_in_pidns(struct nsinfo *nsi)
+{
+	RC_CHK_ACCESS(nsi)->in_pidns = true;
+}
+
 void nsinfo__mountns_enter(struct nsinfo *nsi,
 				  struct nscookie *nc)
 {
diff --git a/tools/perf/util/namespaces.h b/tools/perf/util/namespaces.h
index 8c0731c6cbb7e..e014becb9cd8e 100644
--- a/tools/perf/util/namespaces.h
+++ b/tools/perf/util/namespaces.h
@@ -59,6 +59,7 @@ pid_t nsinfo__tgid(const struct nsinfo  *nsi);
 pid_t nsinfo__nstgid(const struct nsinfo  *nsi);
 pid_t nsinfo__pid(const struct nsinfo  *nsi);
 pid_t nsinfo__in_pidns(const struct nsinfo  *nsi);
+void nsinfo__set_in_pidns(struct nsinfo *nsi);
 
 void nsinfo__mountns_enter(struct nsinfo *nsi, struct nscookie *nc);
 void nsinfo__mountns_exit(struct nscookie *nc);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux