1. 11 Aug, 2022 4 commits
    • Namhyung Kim's avatar
      perf offcpu: Update offcpu test for child process · ade1d030
      Namhyung Kim authored
      Record off-cpu data with perf bench sched messaging workload and count
      the number of offcpu-time events.  Also update the test script not to
      run next tests if failed already and revise the error messages.
      
        $ sudo ./perf test offcpu -v
         88: perf record offcpu profiling tests                              :
        --- start ---
        test child forked, pid 344780
        Checking off-cpu privilege
        Basic off-cpu test
        Basic off-cpu test [Success]
        Child task off-cpu test
        Child task off-cpu test [Success]
        test child finished with 0
        ---- end ----
        perf record offcpu profiling tests: Ok
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220811185456.194721-5-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ade1d030
    • Namhyung Kim's avatar
      perf offcpu: Track child processes · d2347763
      Namhyung Kim authored
      When -p option used or a workload is given, it needs to handle child
      processes.  The perf_event can inherit those task events
      automatically.  We can add a new BPF program in task_newtask
      tracepoint to track child processes.
      
      Before:
        $ sudo perf record --off-cpu -- perf bench sched messaging
        $ sudo perf report --stat | grep -A1 offcpu
        offcpu-time stats:
                  SAMPLE events:        1
      
      After:
        $ sudo perf record -a --off-cpu -- perf bench sched messaging
        $ sudo perf report --stat | grep -A1 offcpu
        offcpu-time stats:
                  SAMPLE events:      856
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220811185456.194721-4-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d2347763
    • Namhyung Kim's avatar
      perf offcpu: Parse process id separately · d6f415ca
      Namhyung Kim authored
      The current target code uses thread id for tracking tasks because
      perf_events need to be opened for each task.  But we can use tgid in
      BPF maps and check it easily.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220811185456.194721-3-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d6f415ca
    • Namhyung Kim's avatar
      perf offcpu: Check process id for the given workload · 07fc958b
      Namhyung Kim authored
      Current task filter checks task->pid which is different for each
      thread.  But we want to profile all the threads in the process.  So
      let's compare process id (or thread-group id: tgid) instead.
      
      Before:
        $ sudo perf record --off-cpu -- perf bench sched messaging -t
        $ sudo perf report --stat | grep -A1 offcpu
        offcpu-time stats:
                  SAMPLE events:        2
      
      After:
        $ sudo perf record --off-cpu -- perf bench sched messaging -t
        $ sudo perf report --stat | grep -A1 offcpu
        offcpu-time stats:
                  SAMPLE events:      850
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220811185456.194721-2-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      07fc958b
  2. 10 Aug, 2022 23 commits
  3. 09 Aug, 2022 13 commits