1. 09 10月, 2019 7 次提交
    • A
      perf evlist: Factor out asprintf routine to build a tracepoint pid filter · 05cea449
      Arnaldo Carvalho de Melo 提交于
      Will be used to append such lists to existing filters.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-798vlyqfqw938ehoe8etivx1@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      05cea449
    • A
      perf trace: Associate the "msr" tracepoint arg name with x86_MSR__scnprintf() · c330ef28
      Arnaldo Carvalho de Melo 提交于
      So that we can go from:
      
        # perf trace -e msr:write_msr --max-stack=16 sleep 1
             0.000 sleep/6740 msr:write_msr(msr: 3221225728, val: 139636317451648)
                                               do_trace_write_msr ([kernel.kallsyms])
                                               do_trace_write_msr ([kernel.kallsyms])
                                               do_arch_prctl_64 ([kernel.kallsyms])
                                               __x64_sys_arch_prctl ([kernel.kallsyms])
                                               do_syscall_64 ([kernel.kallsyms])
                                               entry_SYSCALL_64 ([kernel.kallsyms])
                                               init_tls (/usr/lib64/ld-2.29.so)
                                               dl_main (/usr/lib64/ld-2.29.so)
                                               _dl_sysdep_start (/usr/lib64/ld-2.29.so)
                                               _dl_start (/usr/lib64/ld-2.29.so)
        #
      
      To:
      
        # perf trace -e msr:write_msr --max-stack=16 sleep 1
           0.000 sleep/8519 msr:write_msr(msr: FS_BASE, val: 139878031705472)
                                             do_trace_write_msr ([kernel.kallsyms])
                                             do_trace_write_msr ([kernel.kallsyms])
                                             do_arch_prctl_64 ([kernel.kallsyms])
                                             __x64_sys_arch_prctl ([kernel.kallsyms])
                                             do_syscall_64 ([kernel.kallsyms])
                                             entry_SYSCALL_64 ([kernel.kallsyms])
                                             init_tls (/usr/lib64/ld-2.29.so)
                                             dl_main (/usr/lib64/ld-2.29.so)
                                             _dl_sysdep_start (/usr/lib64/ld-2.29.so)
                                             _dl_start (/usr/lib64/ld-2.29.so)
        #
      
      This, in reverse, will allow for symbolic system call/tracepoint
      filtering.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-q1q4unmqja5ex7dy0kb5cjaa@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c330ef28
    • A
      perf trace beauty: Add the glue for the autogenerated MSR arrays · 646b3e2c
      Arnaldo Carvalho de Melo 提交于
      We need to wrap those autogenerated string arrays with the
      strarrays__scnprintf() formatter, do it.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-wqjz4kwi4a0ot6lsis3kc65j@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      646b3e2c
    • A
      perf trace: Allow associating scnprintf routines with well known arg names · 5d88099b
      Arnaldo Carvalho de Melo 提交于
      For instance 'msr' appears in several tracepoints, so we can associate
      it with a single scnprintf() routine auto-generated from kernel headers,
      as will be done in followup patches.
      
      Start with an empty array of associations.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-89ptht6s5fez82lykuwq1eyb@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5d88099b
    • A
      perf beauty: Hook up the x86 MSR table generator · fd218347
      Arnaldo Carvalho de Melo 提交于
      This way we generate the source with the table for later use by plugins,
      etc.
      
      I.e. after running:
      
        $ make -C tools/perf O=/tmp/build/perf
      
      We end up with:
      
        $ head /tmp/build/perf/trace/beauty/generated/x86_arch_MSRs_array.c
        static const char *x86_MSRs[] = {
        	[0x00000000] = "IA32_P5_MC_ADDR",
        	[0x00000001] = "IA32_P5_MC_TYPE",
        	[0x00000010] = "IA32_TSC",
        	[0x00000017] = "IA32_PLATFORM_ID",
        	[0x0000001b] = "IA32_APICBASE",
        	[0x00000020] = "KNC_PERFCTR0",
        	[0x00000021] = "KNC_PERFCTR1",
        	[0x00000028] = "KNC_EVNTSEL0",
        	[0x00000029] = "KNC_EVNTSEL1",
        $
      
      Now its just a matter of using it, first in a libtracevent plugin.
      
      At some point we should move tools/perf/trace/beauty to tools/beauty/,
      so that it can be used more generally and even made available externally
      like libbpf, libperf, libtraevent, etc.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-b3rmutg4igcohx6kpo67qh4j@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fd218347
    • A
      perf trace beauty: Add a x86 MSR cmd id->str table generator · 693d3458
      Arnaldo Carvalho de Melo 提交于
      Without parameters it'll parse tools/arch/x86/include/asm/msr-index.h
      and output a table usable by tools, that will be wired up later to a
      libtraceevent plugin registered from perf's glue code:
      
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh
        static const char *x86_MSRs[] = {
       <SNIP>
        	[0x00000034] = "SMI_COUNT",
        	[0x0000003a] = "IA32_FEATURE_CONTROL",
        	[0x0000003b] = "IA32_TSC_ADJUST",
        	[0x00000040] = "LBR_CORE_FROM",
        	[0x00000048] = "IA32_SPEC_CTRL",
        	[0x00000049] = "IA32_PRED_CMD",
       <SNIP>
        	[0x0000010b] = "IA32_FLUSH_CMD",
        	[0x0000010F] = "TSX_FORCE_ABORT",
       <SNIP>
        	[0x00000198] = "IA32_PERF_STATUS",
        	[0x00000199] = "IA32_PERF_CTL",
        <SNIP>
        	[0x00000da0] = "IA32_XSS",
        	[0x00000dc0] = "LBR_INFO_0",
        	[0x00000ffc] = "IA32_BNDCFGS_RSVD",
        };
      
        #define x86_64_specific_MSRs_offset 0xc0000080
        static const char *x86_64_specific_MSRs[] = {
        	[0xc0000080 - x86_64_specific_MSRs_offset] = "EFER",
        	[0xc0000081 - x86_64_specific_MSRs_offset] = "STAR",
        	[0xc0000082 - x86_64_specific_MSRs_offset] = "LSTAR",
        	[0xc0000083 - x86_64_specific_MSRs_offset] = "CSTAR",
        	[0xc0000084 - x86_64_specific_MSRs_offset] = "SYSCALL_MASK",
        <SNIP>
        	[0xc0000103 - x86_64_specific_MSRs_offset] = "TSC_AUX",
        	[0xc0000104 - x86_64_specific_MSRs_offset] = "AMD64_TSC_RATIO",
        };
      
        #define x86_AMD_V_KVM_MSRs_offset 0xc0010000
        static const char *x86_AMD_V_KVM_MSRs[] = {
        	[0xc0010000 - x86_AMD_V_KVM_MSRs_offset] = "K7_EVNTSEL0",
        <SNIP>
        	[0xc0010114 - x86_AMD_V_KVM_MSRs_offset] = "VM_CR",
        	[0xc0010115 - x86_AMD_V_KVM_MSRs_offset] = "VM_IGNNE",
        	[0xc0010117 - x86_AMD_V_KVM_MSRs_offset] = "VM_HSAVE_PA",
        <SNIP>
        	[0xc0010240 - x86_AMD_V_KVM_MSRs_offset] = "F15H_NB_PERF_CTL",
        	[0xc0010241 - x86_AMD_V_KVM_MSRs_offset] = "F15H_NB_PERF_CTR",
        	[0xc0010280 - x86_AMD_V_KVM_MSRs_offset] = "F15H_PTSC",
        };
      
      Then these will in turn be hooked up in a follow up patch to be used by
      strarrays__scnprintf().
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-ja080xawx08kedez855usnon@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      693d3458
    • A
      perf beauty: Make strarray's offset be u64 · 8d6505ba
      Arnaldo Carvalho de Melo 提交于
      We need it for things like MSRs that are sparse and go over MAXINT.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-g8t2d0jr0mg3yimg2qrjkvlt@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8d6505ba
  2. 07 10月, 2019 30 次提交
    • A
      tools arch x86: Grab a copy of the file containing the MSR numbers · 444e2ff3
      Arnaldo Carvalho de Melo 提交于
      We'll use it to generate a table and then convert the
      msr:{read,write}_msr 'msr' option in things like perf trace, script,
      etc.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-y1f4s0y1s43d4drh7pd2huzn@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      444e2ff3
    • A
      perf trace: Allow choosing how to augment the tracepoint arguments · f11b2803
      Arnaldo Carvalho de Melo 提交于
      So far we used the libtraceevent printing routines when showing
      tracepoint arguments, but since 'perf trace' has a lot of beautifiers
      for syscall arguments, and since some of those can be used to augment
      tracepoint arguments, add a routine to make use of those beautifiers
      and allow the user to choose which one to use.
      
      The default now is to use the same beautifiers used for the strace-like
      sys_enter+sys_exit lines, but the user can choose the libtraceevent ones
      by either using the:
      
          perf trace --libtraceevent_print
      
      command line option, or by setting:
      
        # cat ~/.perfconfig
        [trace]
      	tracepoint_beautifiers = libtraceevent
      
      For instance, here are some examples:
      
        # perf trace -e sched:*switch,*sleep,sched:*wakeup,exit*,sched:*exit sleep 1
             0.000 sched:sched_wakeup(comm: "perf", pid: 5273 (perf), prio: 120, success: 1, target_cpu: 6)
             0.621 nanosleep(rqtp: 0x7ffdd06d1140, rmtp: NULL) ...
             0.628 sched:sched_switch(prev_comm: "sleep", prev_pid: 5273 (sleep), prev_prio: 120, prev_state: 1, next_comm: "swapper/6", next_pid: 0, next_prio: 120)
          1000.879 sched:sched_wakeup(comm: "sleep", pid: 5273 (sleep), prio: 120, success: 1, target_cpu: 6)
             0.621  ... [continued]: nanosleep())          = 0
          1001.026 exit_group(error_code: 0)               = ?
          1001.216 sched:sched_process_exit(comm: "sleep", pid: 5273 (sleep), prio: 120)
        #
      
      And then using libtraceevent, as before:
      
        # perf trace --libtraceevent_print -e sched:*switch,*sleep,sched:*wakeup,exit*,sched:*exit sleep 1
             0.000 sched:sched_wakeup(comm=perf pid=5288 prio=120 target_cpu=001)
             0.739 nanosleep(rqtp: 0x7ffeba6c2f40, rmtp: NULL) ...
             0.747 sched:sched_switch(prev_comm=sleep prev_pid=5288 prev_prio=120 prev_state=S ==> next_comm=swapper/1 next_pid=0 next_prio=120)
          1000.902 sched:sched_wakeup(comm=sleep pid=5288 prio=120 target_cpu=001)
             0.739  ... [continued]: nanosleep())          = 0
          1001.012 exit_group(error_code: 0)               = ?
        #
      
      The new default allocates an array of 'struct syscall_arg_fmt' for the
      tracepoint arguments and, just like with syscall arguments, tries to
      find suitable syscall_arg__scnprintf_NAME() routines to augment those
      tracepoint arguments based on their type (as in the tracefs "format"
      file), or even in their name + type, for instance arguntents with names
      ending in "fd" with type "int" get the fd scnprintf beautifier attached,
      etc.
      
      Soon this will take advantage of the kernel BTF information to augment
      enumerations based on the tracefs "format" type info.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-o8qdluotkcb3b1x2gjqrejcl@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f11b2803
    • A
      perf trace: Enclose all events argument lists with () · 311baaf9
      Arnaldo Carvalho de Melo 提交于
      So that they look a bit like normal strace-like syscall enter+exit
      lines.
      
      They will look even more when we switch from using libtraceevent's
      tep_print_event() routine in favour of using all the perf beautifiers
      used by the strace-like syscall enter+exit lines.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-y4fcej6v6u1m644nbxd2r4pg@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      311baaf9
    • A
      perf trace: Add array of chars scnprintf beautifier · 9597945d
      Arnaldo Carvalho de Melo 提交于
      Needed for sched's traceoints prev/next comm, where, unlike with
      syscalls, we are not dealing with an integer or pointer, but an array
      straight out from the ring buffer.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-rlll7tmcqe1g4odtaifil5re@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9597945d
    • A
      perf trace: Add the syscall_arg_fmt pointer to syscall_arg · 888ca854
      Arnaldo Carvalho de Melo 提交于
      So that the scnprintf beautifiers can access it, as will be the case
      with the char array one in the following csets, that needs to know
      the number of elements in an array.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-01qmjqv6cb1nj1qy4khdexce@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      888ca854
    • A
      perf trace: Move some scnprintf methods from syscall to syscall_arg_fmt · 3e0c9b2c
      Arnaldo Carvalho de Melo 提交于
      Since all they operate on is on a syscall_arg_fmt instance, so move them
      to allow use it from the upcoming tracepoint fprintf routine.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-ynttrs1l75f0x9tk67spd7jd@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3e0c9b2c
    • A
      perf trace: Allocate an array of beautifiers for tracepoint args · 947b843c
      Arnaldo Carvalho de Melo 提交于
      This will work similar to the syscall args, we'll allocate an array
      of 'struct syscall_arg_fmt' for the tracepoint args and then init them
      using the same algorithm used for the defaults for syscall args, i.e.
      using its types and sometimes names as hints to find the right scnprintf
      routine to beautify them from numbers into strings.
      
      Next step is to stop using libtracevent to printf tracepoints, as we'll
      have more beautifiers than int provides, modulo perhaps some plugins.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-dcl135relxvf6ljisjg13aqg@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      947b843c
    • A
      perf trace: Factor out the initialization of syscal_arg_fmt->scnprintf · 8d1d4ff5
      Arnaldo Carvalho de Melo 提交于
      We set the default scnprint routines for the syscall args based on its
      type or on heuristics based on its names, now we'll use this for
      tracepoints as well, so move it out of syscall__set_arg_fmts() and into
      a routine that receive just an array of syscall_arg_fmt entries + the
      tracepoint format fields list.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-xs3x0zzyes06c7scdsjn01ty@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8d1d4ff5
    • A
      perf script: Allow --time with --reltime · 3714437d
      Andi Kleen 提交于
      The original --reltime patch forbid --time with --reltime.
      
      But it turns out --time doesn't really care about --reltime, because the
      relative time is only used at final output, while the time filtering
      always works earlier on absolute time.
      
      So just remove the check and allow combining the two options.
      
      Fixes: 90b10f47 ("perf script: Support relative time")
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Link: http://lore.kernel.org/lkml/20191002164642.1719-1-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3714437d
    • B
      samples/bpf: fix build by setting HAVE_ATTR_TEST to zero · fce9501a
      Björn Töpel 提交于
      To remove that test_attr__{enabled/open} are used by perf-sys.h, we
      set HAVE_ATTR_TEST to zero.
      Signed-off-by: NBjörn Töpel <bjorn.topel@intel.com>
      Tested-by: NKP Singh <kpsingh@google.com>
      Acked-by: NSong Liu <songliubraving@fb.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: bpf@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Link: http://lore.kernel.org/lkml/20191001113307.27796-3-bjorn.topel@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fce9501a
    • B
      perf tools: Make usage of test_attr__* optional for perf-sys.h · 06f84d19
      Björn Töpel 提交于
      For users of perf-sys.h outside perf, e.g. samples/bpf/bpf_load.c, it's
      convenient not to depend on test_attr__*.
      
      After commit 91854f9a ("perf tools: Move everything related to
      sys_perf_event_open() to perf-sys.h"), all users of perf-sys.h will
      depend on test_attr__enabled and test_attr__open.
      
      This commit enables a user to define HAVE_ATTR_TEST to zero in order
      to omit the test dependency.
      
      Fixes: 91854f9a ("perf tools: Move everything related to sys_perf_event_open() to perf-sys.h")
      Signed-off-by: NBjörn Töpel <bjorn.topel@intel.com>
      Acked-by: NSong Liu <songliubraving@fb.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: bpf@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Link: http://lore.kernel.org/lkml/20191001113307.27796-2-bjorn.topel@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      06f84d19
    • A
      perf scripts python: exported-sql-viewer.py: Add Time chart by CPU · b3700f21
      Adrian Hunter 提交于
      Add a time chart based on context switch information.
      
      Context switch information was added to the database export fairly
      recently, so the chart menu option will only appear if context switch
      information is in the database.
      
      Refer to the Exported SQL Viewer Help option for more information about
      the chart.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lore.kernel.org/lkml/20190821083216.1340-7-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b3700f21
    • A
      perf scripts python: exported-sql-viewer.py: Add ability for Call tree to open... · e69d5df7
      Adrian Hunter 提交于
      perf scripts python: exported-sql-viewer.py: Add ability for Call tree to open at a specified task and time
      
      Add ability for Call tree to open at a specified task and time.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lore.kernel.org/lkml/20190821083216.1340-6-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e69d5df7
    • A
      perf scripts python: exported-sql-viewer.py: Tidy up Call tree call_time · da4264f5
      Adrian Hunter 提交于
      Record call_time on tree nodes and re-name the misnamed "count" parameter.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lore.kernel.org/lkml/20190821083216.1340-5-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      da4264f5
    • A
      perf scripts python: exported-sql-viewer.py: Add global time range calculations · 9a9dae36
      Adrian Hunter 提交于
      Add calculations to determine a time range that encompasses all data.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lore.kernel.org/lkml/20190821083216.1340-4-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9a9dae36
    • A
      perf scripts python: exported-sql-viewer.py: Add HBoxLayout and VBoxLayout · 42c303ff
      Adrian Hunter 提交于
      Add layout classes HBoxLayout and VBoxLayout.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lore.kernel.org/lkml/20190821083216.1340-3-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      42c303ff
    • A
      perf scripts python: exported-sql-viewer.py: Add LookupModel() · 181ea40a
      Adrian Hunter 提交于
      Add LookupModel() to find a model in the model cache without creating it.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lore.kernel.org/lkml/20190821083216.1340-2-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      181ea40a
    • A
      perf trace augmented_syscalls: Do not show syscalls when none was asked for · 8bd436b0
      Arnaldo Carvalho de Melo 提交于
      When not using augmented syscalls, i.e. not passing thru the command
      line a eBPF source or object file event that provides the
      __augmented_syscalls__ BPF_MAP_TYPE_PERF_EVENT_ARRAY, etc, as with:
      
         perf trace -e tools/perf/examples/bpf/augmented_raw_syscalls.c
      
      or passing that augmented eBPF source/object via the trace.add_events in
      .perfconfig file, we were assuming that syscalls were asked for,
      differing from when not using augmented syscalls at all.
      
      This is confusing when using .perfconfig to hide the fact we're using
      the augmenter, i.e. using:
      
       # perf trace -e sched:* sleep 1
      
      Will show both the scheduler tracepoints and the syscalls, where what we
      want is to show just the scheduler tracepoints.
      
      To see the scheduler tracepoints and some specific syscall strace-like
      formatting, one has to use:
      
        # perf trace -e sched:*,nanosleep sleep 1
      
      Or, if wanting all the syscalls:
      
        # perf trace -e sched:* --syscalls sleep 1
      
      This way 'perf trace' can be used to trace just a set of tracepoints
      while allowing for mixing with strace-like when desired, by simply
      adding to the mix the name of the syscalls to show in addition to the
      tracepoints.
      
      Fix it so that the behaviour using the eBPF based syscall augmenter is
      the same as when not using one.
      
      Testing:
      
      Before this patch, with this ~/.perfconfig:
      
        # egrep -B1 ^[[:space:]]+add_events ~/.perfconfig
        [trace]
        	add_events = /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o
        #
      
      That points to this pre-compiled eBPF syscall augmenter:
      
        # file /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o
        /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o: ELF 64-bit LSB relocatable, eBPF, version 1 (SYSV), with debug_info, not stripped
      
      And when asking for _only_ sched:sched_switch and sched:sched_wakeup we
      were unconditionally getting all the syscalls formatted strace-like:
      
        # perf trace -e sched:*switch,sched:*wakeup sleep 1 |& tail
           0.633 fstat(3, 0x7fe11d030ac0)                = 0
           0.635 mmap(NULL, 217750512, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fe10fec5000
           0.643 close(3)                                = 0
           0.668 nanosleep(0x7fff649a3a90, NULL)      ...
           0.672 sched:sched_switch:prev_comm=sleep prev_pid=4417 prev_prio=120 prev_state=S ==> next_comm=swapper/6 next_pid=0 next_prio=120
        1000.822 sched:sched_wakeup:comm=sleep pid=4417 prio=120 target_cpu=006
           0.668  ... [continued]: nanosleep())          = 0
        1000.923 close(1)                                = 0
        1000.941 close(2)                                = 0
        1000.974 exit_group(0)                           = ?
        #
      
      After the patch:
      
        # perf trace -e sched:*switch,sched:*wakeup sleep 1
           0.000 sched:sched_wakeup:comm=perf pid=5529 prio=120 target_cpu=005
           1.186 sched:sched_switch:prev_comm=sleep prev_pid=5529 prev_prio=120 prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120
        1001.573 sched:sched_wakeup:comm=sleep pid=5529 prio=120 target_cpu=005
        #
      
      If we add the "open*" syscalls to the mix then the eBPF augmented _will_
      be used and these syscalls will be traced together with the specified
      sched tracepoints:
      
        # cd /sys/kernel/debug/tracing/events/syscalls/
        # ls -1d sys_enter_open*
        sys_enter_open
        sys_enter_openat
        sys_enter_open_by_handle_at
        sys_enter_open_tree
        #
      
        # perf trace -e open*,sched:*switch,sched:*wakeup sleep 1
             0.000 sched:sched_wakeup:comm=perf pid=5580 prio=120 target_cpu=005
             0.590 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
             0.616 openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
             0.846 openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
             0.891 sched:sched_switch:prev_comm=sleep prev_pid=5580 prev_prio=120 prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120
          1001.005 sched:sched_wakeup:comm=sleep pid=5580 prio=120 target_cpu=005
        #
      
      And as we can see, the pathnames were collected via the eBPF augmenters.
      
      If we don't specify anything it'll trace all syscalls:
      
        # perf trace sleep 1 |& tail
             0.299 brk(0x5597543a3000)                     = 0x5597543a3000
             0.302 brk(NULL)                               = 0x5597543a3000
             0.307 openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
             0.313 fstat(3, 0x7feece50cac0)                = 0
             0.315 mmap(NULL, 217750512, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7feec13a1000
             0.323 close(3)                                = 0
             0.354 nanosleep(0x7ffe338856e0, NULL)         = 0
          1000.641 close(1)                                = 0
          1000.655 close(2)                                = 0
          1000.673 exit_group(0)                           = ?
        #
      
      Ditto if we don't use .perfconfig's trace.add_events but instead pass
      just the augmenter as a command line event:
      
        # vim ~/.perfconfig
        # egrep -B1 ^[[:space:]]+add_events ~/.perfconfig
        # perf trace -e /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o sleep 1 |& tail
             0.294 brk(0x55ae08ec3000)                     = 0x55ae08ec3000
             0.297 brk(NULL)                               = 0x55ae08ec3000
             0.302 openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
             0.309 fstat(3, 0x7f726488fac0)                = 0
             0.311 mmap(NULL, 217750512, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7257724000
             0.319 close(3)                                = 0
             0.347 nanosleep(0x7ffe23643a70, NULL)         = 0
          1000.560 close(1)                                = 0
          1000.575 close(2)                                = 0
          1000.593 exit_group(0)                           = ?
        #
      
      As well as that + some syscall names for strace-like formatting:
      
        # perf trace -e socket,connect,/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o ssh localhost
             0.000 socket(PF_LOCAL, SOCK_STREAM|CLOEXEC|NONBLOCK, 0) = 3
             0.021 connect(3, { .family: PF_LOCAL, path: /var/run/nscd/socket }, 110) = -1 ENOENT (No such file or directory)
             0.034 socket(PF_LOCAL, SOCK_STREAM|CLOEXEC|NONBLOCK, 0) = 3
             0.041 connect(3, { .family: PF_LOCAL, path: /var/run/nscd/socket }, 110) = -1 ENOENT (No such file or directory)
             0.163 socket(PF_LOCAL, SOCK_STREAM, 0)        = 4
             0.185 connect(4, { .family: PF_LOCAL, path: /var/lib/sss/pipes/nss }, 110) = 0
             0.670 socket(PF_LOCAL, SOCK_STREAM|CLOEXEC|NONBLOCK, 0) = 7
             0.684 connect(7, { .family: PF_LOCAL, path: /var/run/nscd/socket }, 110) = -1 ENOENT (No such file or directory)
             0.694 socket(PF_LOCAL, SOCK_STREAM|CLOEXEC|NONBLOCK, 0) = 7
             0.701 connect(7, { .family: PF_LOCAL, path: /var/run/nscd/socket }, 110) = -1 ENOENT (No such file or directory)
             0.994 socket(PF_LOCAL, SOCK_STREAM|CLOEXEC|NONBLOCK, 0) = 5
             1.006 connect(5, { .family: PF_LOCAL, path: /var/run/nscd/socket }, 110) = -1 ENOENT (No such file or directory)
             1.014 socket(PF_LOCAL, SOCK_STREAM|CLOEXEC|NONBLOCK, 0) = 5
             1.022 connect(5, { .family: PF_LOCAL, path: /var/run/nscd/socket }, 110) = -1 ENOENT (No such file or directory)
             1.068 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 5
             1.087 connect(5, { .family: PF_INET, port: 22, addr: 127.0.0.1 }, 16) = 0
            24.299 socket(PF_LOCAL, SOCK_STREAM, 0)        = 6
            24.337 connect(6, { .family: PF_LOCAL, path: /var/run/.heim_org.h5l.kcm-socket }, 110) = 0
            28.441 socket(PF_LOCAL, SOCK_STREAM, 0)        = 6
            28.516 connect(6, { .family: PF_LOCAL, path: /var/run/.heim_org.h5l.kcm-socket }, 110) = 0
        root@localhost's password:^C
        #
      
      Everything works without augmenters:
      
        # egrep -B1 ^[[:space:]]+add_events ~/.perfconfig
        # perf trace sleep 1 |& tail
             0.261 brk(0x5635068ac000)                     = 0x5635068ac000
             0.264 brk(NULL)                               = 0x5635068ac000
             0.268 openat(AT_FDCWD, 0xdce642a0, O_RDONLY|O_CLOEXEC) = 3
             0.275 fstat(3, 0x7f3fdce97ac0)                = 0
             0.277 mmap(NULL, 217750512, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f3fcfd2c000
             0.284 close(3)                                = 0
             0.310 nanosleep(0x7ffdaea6ecd0, NULL)         = 0
          1000.552 close(1)                                = 0
          1000.565 close(2)                                = 0
          1000.580 exit_group(0)                           = ?
        #
      
        # perf trace -e connect ssh localhost
             0.000 connect(3, 0x58266930, 110)             = -1 ENOENT (No such file or directory)
             0.022 connect(3, 0x58266af0, 110)             = -1 ENOENT (No such file or directory)
             0.150 connect(4, 0x58266b00, 110)             = 0
             0.490 connect(7, 0x58264150, 110)             = -1 ENOENT (No such file or directory)
             0.505 connect(7, 0x58264300, 110)             = -1 ENOENT (No such file or directory)
             0.832 connect(5, 0x58266220, 110)             = -1 ENOENT (No such file or directory)
             0.847 connect(5, 0x582663e0, 110)             = -1 ENOENT (No such file or directory)
             0.899 connect(5, 0x95ba0630, 16)              = 0
            25.619 connect(6, 0x58266360, 110)             = 0
            40.564 connect(6, 0x58266330, 110)             = 0
        root@localhost's password: ^C
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-624f6jxic04031tnt40va4dd@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8bd436b0
    • A
      perf trace: Postpone parsing .perfconfig trace.add_events to after --verbose is processed · 7e035929
      Arnaldo Carvalho de Melo 提交于
      When we add events via the '[trace]' section in perfconfig the command
      line options are not yet processed, so when something goes wrong with
      parsing those events and using --verbose is advised, we end up not
      getting any more verbosity by doing so.
      
      So just copy the trace.add_events string for later processing, after we
      processed --verbose and the other command line options.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-d6wbnz85ftqljdll6ynjyjd8@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7e035929
    • A
      perf trace: Generalize the syscall_fmt find routines · bcddbfc5
      Arnaldo Carvalho de Melo 提交于
      To allow them to be used with other stuff, such as tracepoints.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-od3gzg77ppqgnnrxqv40fvgx@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bcddbfc5
    • A
      perf trace: Separate 'struct syscall_fmt' definition from syscall_fmts variable · 9b2036cd
      Arnaldo Carvalho de Melo 提交于
      As this has all the things needed to format tracepoints events, not just
      syscalls, that, after all, are just tracepoints with a set in stone ABI,
      i.e. order and number of parameters.
      
      For tracepoints we'll create a
      
        static struct syscall_fmt tracepoint_fmts[]
      
      array and will fill the ->arg[] entries with the beautifier for each
      positional argument and record the name, then, when we need it, we'll
      just check that the position has the same name, maybe even type, so that
      we can do some check that the tracepoint hasn't changed, if it has, we
      can even reorder things.
      
      Keep calling it syscall_fmt but use it as well for tracepoints, do it
      this way to minimize changes and reuse what is in place for syscalls,
      we'll see.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-2x1jgiev13zt4njaanlnne0d@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9b2036cd
    • A
      perf trace: Make evlist__set_evsel_handler() affect just entries without a handler · 206d635a
      Arnaldo Carvalho de Melo 提交于
      Renaming it to evlist__set_default_evsel_handler(), to better reflect
      what we want to do, which is to set a default handler for events we
      still haven't set a custom handler, like the ones for "msr:write_msr",
      etc that are coming soon.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-e1bit7upnpmtsayh8039kfuw@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      206d635a
    • A
      perf evlist: Adopt __set_tracepoint_handlers method from perf_session · c0e53476
      Arnaldo Carvalho de Melo 提交于
      It all operates on the evsels in the session's evlist, so move it to the
      evlist layer to make it useful to tools not using perf_session, just
      evlists, like 'perf trace' in live mode.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-9oc53gnfi53vg82fvolkm85g@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c0e53476
    • A
      perf top: Initialize perf_env->cpuid, needed by the per arch annotation init routine · 608127f7
      Arnaldo Carvalho de Melo 提交于
      Just read it so that later on the per arch init routine can use it,
      e.g. x86__annotate_init().
      
      When using a perf.data file this is obtained from a header that was put
      there by 'perf record', and then it may be for another machine, another
      arch.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-4t4n3o8l8s0tc2b1pq53hyr4@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      608127f7
    • A
      perf env: Add routine to read the env->cpuid from the running machine · f1cedfb8
      Arnaldo Carvalho de Melo 提交于
      In 'perf top' we use that cpuid when initializing the per arch
      annotation init routines (e.g. x86__annotate_init()) and in that case
      (live mode, 'perf top') we need to obtain it from the running machine,
      not from a perf.data file header.
      
      Provide a means to do that. Will be used by 'perf top' in a followup
      patch.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-h2wb3sx7u7znx6lqfezrh7ca@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f1cedfb8
    • A
      perf/core: Fix inheritance of aux_output groups · f733c6b5
      Alexander Shishkin 提交于
      Commit:
      
        ab43762e ("perf: Allow normal events to output AUX data")
      
      forgets to configure aux_output relation in the inherited groups, which
      results in child PEBS events forever failing to schedule.
      
      Fix this by setting up the AUX output link in the inheritance path.
      Signed-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: https://lkml.kernel.org/r/20191004125729.32397-1-alexander.shishkin@linux.intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      f733c6b5
    • I
      Merge tag 'perf-urgent-for-mingo-5.4-20191001' of... · a4cf7b39
      Ingo Molnar 提交于
      Merge tag 'perf-urgent-for-mingo-5.4-20191001' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
      
      perf script:
      
        Andi Kleen:
      
          - Fix recovery from LBR/binary mismatch in the "brstackinsn" --field.
      
      perf annotate:
      
        Arnaldo Carvalho de Melo:
      
        - Propagate errors so that meaningful messages can be presented to the
          user in case of problems.
      
      perf map:
      
        Steve MacLean:
      
        - Fix handling of maps partially overlapped, resolving symbols in the
          ranges not replaced by new mmaps.
      
      perf tests:
      
        Ian Rogers:
      
        - Use raise() instead of NULL derefs to avoid causing a SIGILL rather than a
          SIGSEGV for optimized builds that turn NULL derefs into ud2 instructions.
      
      perf LLVM:
      
        Ian Rogers:
      
        - Don't access out-of-scope array.
      
      perf inject:
      
        Steve MacLean:
      
        - Fix JIT_CODE_MOVE filename, that was having a u64 truncaded into a 32-bit
          snprintf format and also a missing ".so" suffix in another case.
      
      libsubcmd:
      
        Ian Rogers:
      
        - Make _FORTIFY_SOURCE defines dependent on the feature, avoiding
          false positives with with memory sanitizers such as LLVM's ASan.
      
      Vendor specific events:
      
      Intel:
      
        Andi Kleen:
      
        - Fix period for Intel fixed counters.
      
      s390:
      
        Thomas Richter (2):
      
        - Fix some event details transaction for machine type 8561.
      
      tools headers UAPI:
      
        Arnaldo Carvalho de Melo:
      
        - Sync headers with the kernel, catching new usbdevfs ioctls and
          madvise behaviours to properly decode in 'perf trace' output.
      
      Documentation:
      
        Steve MacLean:
      
        - Correct and clarify jitdump spec.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      a4cf7b39
    • L
      Linux 5.4-rc2 · da0c9ea1
      Linus Torvalds 提交于
      da0c9ea1
    • L
      elf: don't use MAP_FIXED_NOREPLACE for elf executable mappings · b212921b
      Linus Torvalds 提交于
      In commit 4ed28639 ("fs, elf: drop MAP_FIXED usage from elf_map") we
      changed elf to use MAP_FIXED_NOREPLACE instead of MAP_FIXED for the
      executable mappings.
      
      Then, people reported that it broke some binaries that had overlapping
      segments from the same file, and commit ad55eac7 ("elf: enforce
      MAP_FIXED on overlaying elf segments") re-instated MAP_FIXED for some
      overlaying elf segment cases.  But only some - despite the summary line
      of that commit, it only did it when it also does a temporary brk vma for
      one obvious overlapping case.
      
      Now Russell King reports another overlapping case with old 32-bit x86
      binaries, which doesn't trigger that limited case.  End result: we had
      better just drop MAP_FIXED_NOREPLACE entirely, and go back to MAP_FIXED.
      
      Yes, it's a sign of old binaries generated with old tool-chains, but we
      do pride ourselves on not breaking existing setups.
      
      This still leaves MAP_FIXED_NOREPLACE in place for the load_elf_interp()
      and the old load_elf_library() use-cases, because nobody has reported
      breakage for those. Yet.
      
      Note that in all the cases seen so far, the overlapping elf sections
      seem to be just re-mapping of the same executable with different section
      attributes.  We could possibly introduce a new MAP_FIXED_NOFILECHANGE
      flag or similar, which acts like NOREPLACE, but allows just remapping
      the same executable file using different protection flags.
      
      It's not clear that would make a huge difference to anything, but if
      people really hate that "elf remaps over previous maps" behavior, maybe
      at least a more limited form of remapping would alleviate some concerns.
      
      Alternatively, we should take a look at our elf_map() logic to see if we
      end up not mapping things properly the first time.
      
      In the meantime, this is the minimal "don't do that then" patch while
      people hopefully think about it more.
      Reported-by: NRussell King <linux@armlinux.org.uk>
      Fixes: 4ed28639 ("fs, elf: drop MAP_FIXED usage from elf_map")
      Fixes: ad55eac7 ("elf: enforce  MAP_FIXED on overlaying elf segments")
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Kees Cook <keescook@chromium.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b212921b
    • L
      Merge tag 'dma-mapping-5.4-1' of git://git.infradead.org/users/hch/dma-mapping · 7cdb85df
      Linus Torvalds 提交于
      Pull dma-mapping regression fix from Christoph Hellwig:
       "Revert an incorret hunk from a patch that caused problems on various
        arm boards (Andrey Smirnov)"
      
      * tag 'dma-mapping-5.4-1' of git://git.infradead.org/users/hch/dma-mapping:
        dma-mapping: fix false positive warnings in dma_common_free_remap()
      7cdb85df
  3. 06 10月, 2019 3 次提交
    • L
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 43b815c6
      Linus Torvalds 提交于
      Pull ARM SoC fixes from Olof Johansson:
       "A few fixes this time around:
      
         - Fixup of some clock specifications for DRA7 (device-tree fix)
      
         - Removal of some dead/legacy CPU OPP/PM code for OMAP that throws
           warnings at boot
      
         - A few more minor fixups for OMAPs, most around display
      
         - Enable STM32 QSPI as =y since their rootfs sometimes comes from
           there
      
         - Switch CONFIG_REMOTEPROC to =y since it went from tristate to bool
      
         - Fix of thermal zone definition for ux500 (5.4 regression)"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
        ARM: multi_v7_defconfig: Fix SPI_STM32_QSPI support
        ARM: dts: ux500: Fix up the CPU thermal zone
        arm64/ARM: configs: Change CONFIG_REMOTEPROC from m to y
        ARM: dts: am4372: Set memory bandwidth limit for DISPC
        ARM: OMAP2+: Fix warnings with broken omap2_set_init_voltage()
        ARM: OMAP2+: Add missing LCDC midlemode for am335x
        ARM: OMAP2+: Fix missing reset done flag for am3 and am43
        ARM: dts: Fix gpio0 flags for am335x-icev2
        ARM: omap2plus_defconfig: Enable more droid4 devices as loadable modules
        ARM: omap2plus_defconfig: Enable DRM_TI_TFP410
        DTS: ARM: gta04: introduce legacy spi-cs-high to make display work again
        ARM: dts: Fix wrong clocks for dra7 mcasp
        clk: ti: dra7: Fix mcasp8 clock bits
      43b815c6
    • L
      Merge tag 'kbuild-fixes-v5.4' of... · 2d00aee2
      Linus Torvalds 提交于
      Merge tag 'kbuild-fixes-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - remove unneeded ar-option and KBUILD_ARFLAGS
      
       - remove long-deprecated SUBDIRS
      
       - fix modpost to suppress false-positive warnings for UML builds
      
       - fix namespace.pl to handle relative paths to ${objtree}, ${srctree}
      
       - make setlocalversion work for /bin/sh
      
       - make header archive reproducible
      
       - fix some Makefiles and documents
      
      * tag 'kbuild-fixes-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kheaders: make headers archive reproducible
        kbuild: update compile-test header list for v5.4-rc2
        kbuild: two minor updates for Documentation/kbuild/modules.rst
        scripts/setlocalversion: clear local variable to make it work for sh
        namespace: fix namespace.pl script to support relative paths
        video/logo: do not generate unneeded logo C files
        video/logo: remove unneeded *.o pattern from clean-files
        integrity: remove pointless subdir-$(CONFIG_...)
        integrity: remove unneeded, broken attempt to add -fshort-wchar
        modpost: fix static EXPORT_SYMBOL warnings for UML build
        kbuild: correct formatting of header in kbuild module docs
        kbuild: remove SUBDIRS support
        kbuild: remove ar-option and KBUILD_ARFLAGS
      2d00aee2
    • L
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 126195c9
      Linus Torvalds 提交于
      Pull SCSI fixes from James Bottomley:
       "Twelve patches mostly small but obvious fixes or cosmetic but small
        updates"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: qla2xxx: Fix Nport ID display value
        scsi: qla2xxx: Fix N2N link up fail
        scsi: qla2xxx: Fix N2N link reset
        scsi: qla2xxx: Optimize NPIV tear down process
        scsi: qla2xxx: Fix stale mem access on driver unload
        scsi: qla2xxx: Fix unbound sleep in fcport delete path.
        scsi: qla2xxx: Silence fwdump template message
        scsi: hisi_sas: Make three functions static
        scsi: megaraid: disable device when probe failed after enabled device
        scsi: storvsc: setup 1:1 mapping between hardware queue and CPU queue
        scsi: qedf: Remove always false 'tmp_prio < 0' statement
        scsi: ufs: skip shutdown if hba is not powered
        scsi: bnx2fc: Handle scope bits when array returns BUSY or TSF
      126195c9