1. 25 6月, 2010 5 次提交
    • F
      perf: Don't use 4 bytes as a default instruction breakpoint length · aa59a485
      Frederic Weisbecker 提交于
      4 bytes is fine as a default access for data breakpoints. But
      instruction breakpoints should take the native pointer length,
      otherwise we get a -EINVAL in x86-64.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      aa59a485
    • F
      x86: Support for instruction breakpoints · f7809daf
      Frederic Weisbecker 提交于
      Instruction breakpoints need to have a specific length of 0 to
      be working. Bring this support but also take care the user is not
      trying to set an unsupported length, like a range breakpoint for
      example.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      f7809daf
    • F
      x86: Set resume bit before returning from breakpoint exception · 0c4519e8
      Frederic Weisbecker 提交于
      Instruction breakpoints trigger before the instruction executes,
      and returning back from the breakpoint handler brings us again
      to the instruction that breakpointed. This naturally bring to
      a breakpoint recursion.
      
      To solve this, x86 has the Resume Bit trick. When the cpu flags
      have the RF flag set, the next instruction won't trigger any
      instruction breakpoint, and once this instruction is executed,
      RF is cleared back.
      
      This let's us jump back to the instruction that triggered the
      breakpoint without recursion.
      
      Use this when an instruction breakpoint triggers.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      0c4519e8
    • N
      perf: Fix argument of perf_arch_fetch_caller_regs · 5cfaf214
      Nobuhiro Iwamatsu 提交于
      "struct regs" was set to argument of perf_arch_fetch_caller_regs
      off-case. It should be "struct pt_regs".
      
      This fixes various build errors in archs that have CONFIG_PERF_EVENTS=y
      but no overriden implementation of perf_arch_fetch_caller_regs.
      
      cc1: warnings being treated as errors
      In file included from include/linux/ftrace_event.h:8,
                       from include/trace/syscall.h:6,
                       from include/linux/syscalls.h:75,
                       from arch/sh/kernel/sys_sh32.c:9:
      include/linux/perf_event.h:937: error: 'struct regs' declared inside parameter list
      include/linux/perf_event.h:937: error: its scope is only this definition or declaration, which is probably not what you want
      include/linux/perf_event.h: In function 'perf_fetch_caller_regs':
      include/linux/perf_event.h:952: error: passing argument 1 of 'perf_arch_fetch_caller_regs' from incompatible pointer type
      Signed-off-by: NNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <AANLkTinKKFKEBQrZ3Hkj-XCaMwaTqulb-XnFzqEYiFRr@mail.gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      5cfaf214
    • F
      hw_breakpoints: Fix per task breakpoint tracking · 45a73372
      Frederic Weisbecker 提交于
      Freeing a perf event can happen in several ways. A task
      calls perf_event_exit_task() right before exiting. This helper
      will detach all the events from the task context and queue their
      removal through free_event() if they are child tasks. The task
      also loses its context reference there.
      
      Releasing the breakpoint slot from the constraint table is made
      from free_event() that calls release_bp_slot(). We count the number
      of breakpoints this task is running by looking at the task's
      perf_event_ctxp and iterating through its attached events.
      But at this time, the reference to this context has been cleaned up
      already.
      
      So looking at the event->ctx instead of task->perf_event_ctxp
      to count the remaining breakpoints should solve the problem.
      At least it would for child breakpoints, but not for parent ones.
      If the parent exits before the child, it will remove all its
      events from the context but free_event() will be called later,
      on fd release time. And checking the number of breakpoints the
      task has attached to its context at this time is unreliable as all
      events have been removed from the context.
      
      To solve this, we keep track of the list of per task breakpoints.
      On top of it, we maintain our array of numbers of breakpoints used
      by the tasks. We use the context address as a task id.
      
      So, instead of looking at the number of events attached to a context,
      we walk through our list of per task breakpoints and count the number
      of breakpoints that use the same ctx than the one to be reserved or
      released from the constraint table, and update the count on top of this
      result.
      
      In the meantime it solves a bad refcounting, it also solves a warning,
      reported by Paul.
      
      Badness at /home/paulus/kernel/perf/kernel/hw_breakpoint.c:114
      NIP: c0000000000cb470 LR: c0000000000cb46c CTR: c00000000032d9b8
      REGS: c000000118e7b570 TRAP: 0700   Not tainted  (2.6.35-rc3-perf-00008-g76b0f133
      )
      MSR: 9000000000029032 <EE,ME,CE,IR,DR>  CR: 44004424  XER: 000fffff
      TASK = c0000001187dcad0[3143] 'perf' THREAD: c000000118e78000 CPU: 1
      GPR00: c0000000000cb46c c000000118e7b7f0 c0000000009866a0 0000000000000020
      GPR04: 0000000000000000 000000000000001d 0000000000000000 0000000000000001
      GPR08: c0000000009bed68 c00000000086dff8 c000000000a5bf10 0000000000000001
      GPR12: 0000000024004422 c00000000ffff200 0000000000000000 0000000000000000
      GPR16: 0000000000000000 0000000000000000 0000000000000018 00000000101150f4
      GPR20: 0000000010206b40 0000000000000000 0000000000000000 00000000101150f4
      GPR24: c0000001199090c0 0000000000000001 0000000000000000 0000000000000001
      GPR28: 0000000000000000 0000000000000000 c0000000008ec290 0000000000000000
      NIP [c0000000000cb470] .task_bp_pinned+0x5c/0x12c
      LR [c0000000000cb46c] .task_bp_pinned+0x58/0x12c
      Call Trace:
      [c000000118e7b7f0] [c0000000000cb46c] .task_bp_pinned+0x58/0x12c (unreliable)
      [c000000118e7b8a0] [c0000000000cb584] .toggle_bp_task_slot+0x44/0xe4
      [c000000118e7b940] [c0000000000cb6c8] .toggle_bp_slot+0xa4/0x164
      [c000000118e7b9f0] [c0000000000cbafc] .release_bp_slot+0x44/0x6c
      [c000000118e7ba80] [c0000000000c4178] .bp_perf_event_destroy+0x10/0x24
      [c000000118e7bb00] [c0000000000c4aec] .free_event+0x180/0x1bc
      [c000000118e7bbc0] [c0000000000c54c4] .perf_event_release_kernel+0x14c/0x170
      Reported-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      45a73372
  2. 18 6月, 2010 4 次提交
  3. 17 6月, 2010 5 次提交
    • C
      perf probe: Add kernel source path option · 9ed7e1b8
      Chase Douglas 提交于
      The probe plugin requires access to the source code for some operations.  The
      source code must be in the exact same location as specified by the DWARF tags,
      but sometimes the location is an absolute path that cannot be replicated by a
      normal user. This change adds the -s|--source option to allow the user to
      specify the root of the kernel source tree.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      LKML-Reference: <1276543590-10486-1-git-send-email-chase.douglas@canonical.com>
      Signed-off-by: NChase Douglas <chase.douglas@canonical.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9ed7e1b8
    • K
      perf tools: .gitignore += config.make config.make.autogen · cfc21cc6
      Kirill Smelkov 提交于
      These are local-configuration files and should be ignored.
      
      LKML-Reference: <1276516847-25817-1-git-send-email-kirr@landau.phys.spbu.ru>
      Signed-off-by: NKirill Smelkov <kirr@landau.phys.spbu.ru>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cfc21cc6
    • S
      perf record: Add option to avoid updating buildid cache · a1ac1d3c
      Stephane Eranian 提交于
      There are situations where there is enough information in the perf.data
      to process the samples. Updating the buildid cache may add unecessary
      overhead in terms of disk space and time (copying large elf images).
      
      A persistent option to do this already exists via the perfconfig file,
      simply do:
      
      [buildid]
      dir = /dev/null
      
      This patch provides a way to suppress builid cache updates on a per-run
      basis.  It addds a new option, -N, to perf record. Buildids are still
      generated in the perf.data file.
      
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <4c19ef89.93ecd80a.40dc.fffff8e9@mx.google.com>
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a1ac1d3c
    • E
      perf symbols: Function descriptor symbol lookup · 70c3856b
      Eric B Munson 提交于
      Currently symbol resolution does not work for 64-bit programs on architectures
      that use function descriptors such as ppc64.
      
      The problem is that a symbol doesn't point to a text address, it points to a
      data area that contains (amongst other things) a pointer to the text address.
      
      We look for a section called ".opd" which is the function descriptor area. To
      create the full symbol table, when we see a symbol in the function descriptor
      section we load the first pointer and use that as the text address.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <1276523793-15422-1-git-send-email-ebmunson@us.ibm.com>
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NEric B Munson <ebmunson@us.ibm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      70c3856b
    • S
      perf record: Avoid synthesizing mmap() for all processes in per-thread mode · cf103a14
      Stephane Eranian 提交于
      A bug was introduced by commit c45c6ea2.
      
      Perf record was scanning /proc/PID to create synthetic PERF_RECOR_MMAP
      entries even though it was running in per-thread mode. There was a bogus
      check to select what mmaps to synthesize. We only need all processes in
      system-wide mode.
      
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <4c192107.4f1ee30a.4316.fffff98e@mx.google.com>
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cf103a14
  4. 12 6月, 2010 26 次提交