1. 28 11月, 2013 16 次提交
  2. 27 11月, 2013 4 次提交
    • S
      perf/x86: Add RAPL hrtimer support · 65661f96
      Stephane Eranian 提交于
      The RAPL PMU counters do not interrupt on overflow.
      Therefore, the kernel needs to poll the counters
      to avoid missing an overflow. This patch adds
      the hrtimer code to do this.
      
      The timer interval is calculated at boot time
      based on the power unit used by the HW.
      
      There is one hrtimer per-cpu to handle the case
      of multiple simultaneous use across cores on
      the same package + hotplug CPU.
      
      Thanks to Maria Dimakopoulou for her contributions
      to this patch especially on the math aspects.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Reviewed-by: NMaria Dimakopoulou <maria.n.dimakopoulou@gmail.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      [ Applied 32-bit build fix. ]
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: acme@redhat.com
      Cc: jolsa@redhat.com
      Cc: zheng.z.yan@intel.com
      Cc: bp@alien8.de
      Cc: maria.n.dimakopoulou@gmail.com
      Link: http://lkml.kernel.org/r/1384275531-10892-5-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      65661f96
    • S
      perf/x86: Add Intel RAPL PMU support · 4788e5b4
      Stephane Eranian 提交于
      This patch adds a new uncore PMU to expose the Intel
      RAPL energy consumption counters. Up to 3 counters,
      each counting a particular RAPL event are exposed.
      
      The RAPL counters are available on Intel SandyBridge,
      IvyBridge, Haswell. The server skus add a 3rd counter.
      
      The following events are available and exposed in sysfs:
      
        - power/energy-cores: power consumption of all cores on socket
        - power/energy-pkg: power consumption of all cores + LLc cache
        - power/energy-dram: power consumption of DRAM (servers only)
      
      For each event both the unit (Joules) and scale (2^-32 J)
      is exposed in sysfs for use by perf stat and other tools.
      The files are:
      
      	/sys/devices/power/events/energy-*.unit
      	/sys/devices/power/events/energy-*.scale
      
      The RAPL PMU is uncore by nature and is implemented such
      that it only works in system-wide mode. Measuring only
      one CPU per socket is sufficient. The /sys/devices/power/cpumask
      file can be used by tools to figure out which CPUs to monitor
      by default. For instance, on a 2-socket system, 2 CPUs
      (one on each socket) will be shown.
      
      All the counters measure in the same unit (exposed via sysfs).
      The perf_events API exposes all RAPL counters as 64-bit integers
      counting in unit of 1/2^32 Joules (about 0.23 nJ). User level tools
      must convert the counts by multiplying them by 2^-32 to obtain
      Joules. The reason for this is that the kernel avoids
      doing floating point math whenever possible because it is
      expensive (user floating-point state must be saved). The method
      used avoids kernel floating-point usage. There is no loss of
      precision. Thanks to PeterZ for suggesting this approach.
      
      To convert the raw count in Watt:
         W = C * 2.3 / (1e10 * time)
      or ldexp(C, -32).
      
      RAPL PMU is a new standalone PMU which registers with the
      perf_event core subsystem. The PMU type (attr->type) is
      dynamically allocated and is available from /sys/device/power/type.
      
      Sampling is not supported by the RAPL PMU. There is no
      privilege level filtering either.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Reviewed-by: NMaria Dimakopoulou <maria.n.dimakopoulou@gmail.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: acme@redhat.com
      Cc: jolsa@redhat.com
      Cc: zheng.z.yan@intel.com
      Cc: bp@alien8.de
      Link: http://lkml.kernel.org/r/1384275531-10892-4-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      4788e5b4
    • S
      tools/perf/stat: Add event unit and scale support · 410136f5
      Stephane Eranian 提交于
      This patch adds perf stat support for handling event units and
      scales as exported by the kernel.
      
      The kernel can export PMU events actual unit and scaling factor
      via sysfs:
      
        $ ls -1 /sys/devices/power/events/energy-*
        /sys/devices/power/events/energy-cores
        /sys/devices/power/events/energy-cores.scale
        /sys/devices/power/events/energy-cores.unit
        /sys/devices/power/events/energy-pkg
        /sys/devices/power/events/energy-pkg.scale
        /sys/devices/power/events/energy-pkg.unit
        $ cat /sys/devices/power/events/energy-cores.scale
        2.3283064365386962890625e-10
        $ cat cat /sys/devices/power/events/energy-cores.unit
        Joules
      
      This patch modifies the pmu event alias code to check
      for the presence of the .unit and .scale files to load
      the corresponding values. They are then used by perf stat
      transparently:
      
         # perf stat -a -e power/energy-pkg/,power/energy-cores/,cycles -I 1000 sleep 1000
         #          time             counts   unit events
             1.000214717               3.07 Joules power/energy-pkg/         [100.00%]
             1.000214717               0.53 Joules power/energy-cores/
             1.000214717           12965028        cycles                    [100.00%]
             2.000749289               3.01 Joules power/energy-pkg/
             2.000749289               0.52 Joules power/energy-cores/
             2.000749289           15817043        cycles
      
      When the event does not have an explicit unit exported by
      the kernel, nothing is printed. In csv output mode, there
      will be an empty field.
      
      Special thanks to Jiri for providing the supporting code
      in the parser to trigger reading of the scale and unit files.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Reviewed-by: NJiri Olsa <jolsa@redhat.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: zheng.z.yan@intel.com
      Cc: bp@alien8.de
      Cc: maria.n.dimakopoulou@gmail.com
      Cc: acme@redhat.com
      Link: http://lkml.kernel.org/r/1384275531-10892-3-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      410136f5
    • S
      perf: Add active_entry list head to struct perf_event · 71ad88ef
      Stephane Eranian 提交于
      This patch adds a new field to the struct perf_event.
      It is intended to be used to chain events which are
      active (enabled). It helps in the hardware layer
      for PMUs which do not have actual counter restrictions, i.e.,
      free running read-only counters. Active events are chained
      as opposed to being tracked via the counter they use.
      
      To save space we use a union with hlist_entry as both
      are mutually exclusive (suggested by Jiri Olsa).
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: acme@redhat.com
      Cc: jolsa@redhat.com
      Cc: zheng.z.yan@intel.com
      Cc: bp@alien8.de
      Cc: maria.n.dimakopoulou@gmail.com
      Link: http://lkml.kernel.org/r/1384275531-10892-2-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      71ad88ef
  3. 21 11月, 2013 1 次提交
  4. 20 11月, 2013 7 次提交
  5. 19 11月, 2013 12 次提交
    • V
      perf/trace: Properly use u64 to hold event_id · 0022cedd
      Vince Weaver 提交于
      The 64-bit attr.config value for perf trace events was being copied into
      an "int" before doing a comparison, meaning the top 32 bits were
      being truncated.
      
      As far as I can tell this didn't cause any errors, but it did mean
      it was possible to create valid aliases for all the tracepoint ids
      which I don't think was intended.  (For example, 0xffffffff00000018
      and 0x18 both enable the same tracepoint).
      Signed-off-by: NVince Weaver <vincent.weaver@maine.edu>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1311151236100.11932@vincent-weaver-1.um.maine.eduSigned-off-by: NIngo Molnar <mingo@kernel.org>
      0022cedd
    • P
      perf: Remove fragile swevent hlist optimization · 06db0b21
      Peter Zijlstra 提交于
      Currently we only allocate a single cpu hashtable for per-cpu
      swevents; do away with this optimization for it is fragile in the face
      of things like perf_pmu_migrate_context().
      
      The easiest thing is to make sure all CPUs are consistent wrt state.
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20130913111447.GN31370@twins.programming.kicks-ass.netSigned-off-by: NIngo Molnar <mingo@kernel.org>
      06db0b21
    • P
      ftrace, perf: Avoid infinite event generation loop · d5b5f391
      Peter Zijlstra 提交于
      Vince's perf-trinity fuzzer found yet another 'interesting' problem.
      
      When we sample the irq_work_exit tracepoint with period==1 (or
      PERF_SAMPLE_PERIOD) and we add an fasync SIGNAL handler we create an
      infinite event generation loop:
      
        ,-> <IPI>
        |     irq_work_exit() ->
        |       trace_irq_work_exit() ->
        |         ...
        |           __perf_event_overflow() -> (due to fasync)
        |             irq_work_queue() -> (irq_work_list must be empty)
        '---------      arch_irq_work_raise()
      
      Similar things can happen due to regular poll() wakeups if we exceed
      the ring-buffer wakeup watermark, or have an event_limit.
      
      To avoid this, dis-allow sampling this particular tracepoint.
      
      In order to achieve this, create a special perf_perm function pointer
      for each event and call this (when set) on trying to create a
      tracepoint perf event.
      
      [ roasted: use expr... to allow for ',' in your expression ]
      Reported-by: NVince Weaver <vincent.weaver@maine.edu>
      Tested-by: NVince Weaver <vincent.weaver@maine.edu>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Link: http://lkml.kernel.org/r/20131114152304.GC5364@laptop.programming.kicks-ass.netSigned-off-by: NIngo Molnar <mingo@kernel.org>
      d5b5f391
    • S
      tools lib traceevent: Fix use of multiple options in processing field · eff2c92f
      Steven Rostedt 提交于
      Jiri Olsa reported that the scsi_dispatch_cmd_done event failed to parse
      with:
      
        Error: expected type 5 but read 4
        Error: expected type 5 but read 4
      
      The problem is with this part of the print_fmt:
      
        __print_symbolic(((REC->result) >> 24) & 0xff, ...
      
      The __print_symbolic() helper function's first parameter is the field to
      use to determine what symbol to print based on the value of the result.
      The parser can handle one operation, but it can not handle multiple
      operations ('>>' and '&').
      
      Add code to process all operations for the field argument for
      __print_symbolic() as well as __print_flags().
      Reported-by: NJiri Olsa <jolsa@redhat.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20131118142314.27ca334b@gandalf.local.homeSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eff2c92f
    • N
      perf header: Fix possible memory leaks in process_group_desc() · 50a2740b
      Namhyung Kim 提交于
      After processing all group descriptors or encountering an error, it
      frees all descriptors.  However, current logic can leak memory since it
      might not traverse all descriptors.
      
      Note that the 'i' can have different value than nr_groups when an error
      occurred and it's safe to call free(desc[i].name) for every desc since
      we already make it NULL when it's reused for group names.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1384741244-7271-2-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      50a2740b
    • N
      perf header: Fix bogus group name · 210e812f
      Namhyung Kim 提交于
      When processing event group descriptor in perf file header, we reuse an
      allocated group name but forgot to prevent it from freeing.
      Reported-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1384741244-7271-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      210e812f
    • F
      perf tools: Tag thread comm as overriden · a5285ad9
      Frederic Weisbecker 提交于
      The problem is that when a thread overrides its default ":%pid" comm, we
      forget to tag the thread comm as overriden. Hence, this overriden comm
      is not inherited on future forks. Fix it.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Tested-by: NDavid Ahern <dsahern@gmail.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20131116010207.GA18855@localhost.localdomainSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a5285ad9
    • A
      seq_file: always clear m->count when we free m->buf · 801a7605
      Al Viro 提交于
      Once we'd freed m->buf, m->count should become zero - we have no valid
      contents reachable via m->buf.
      Reported-by: NCharley (Hao Chuan) Chu <charley.chu@broadcom.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      801a7605
    • L
      Merge git://www.linux-watchdog.org/linux-watchdog · 27b5c3f3
      Linus Torvalds 提交于
      Pull watchdog changes from Wim Van Sebroeck:
       - addition of MOXA ART watchdog driver (moxart_wdt)
       - addition of CSR SiRFprimaII and SiRFatlasVI watchdog driver
         (sirfsoc_wdt)
       - addition of ralink watchdog driver (rt2880_wdt)
       - various fixes and cleanups (__user annotation, ioctl return codes,
         removal of redundant of_match_ptr, removal of unnecessary
         amba_set_drvdata(), use allocated buffer for usb_control_msg, ...)
       - removal of MODULE_ALIAS_MISCDEV statements
       - watchdog related DT bindings
       - first set of improvements on the w83627hf_wdt driver
      
      * git://www.linux-watchdog.org/linux-watchdog: (26 commits)
        watchdog: w83627hf: Use helper functions to access superio registers
        watchdog: w83627hf: Enable watchdog device only if not already enabled
        watchdog: w83627hf: Enable watchdog only once
        watchdog: w83627hf: Convert to watchdog infrastructure
        watchdog: omap_wdt: raw read and write endian fix
        watchdog: sirf: don't depend on dummy value of CLOCK_TICK_RATE
        watchdog: pcwd_usb: overflow in usb_pcwd_send_command()
        watchdog: rt2880_wdt: fix return value check in rt288x_wdt_probe()
        watchdog: watchdog_core: Fix a trivial typo
        watchdog: dw: Enable OF support for DW watchdog timer
        watchdog: Get rid of MODULE_ALIAS_MISCDEV statements
        watchdog: ts72xx_wdt: Propagate return value from timeout_to_regval
        watchdog: pcwd_usb: Use allocated buffer for usb_control_msg
        watchdog: sp805_wdt: Remove unnecessary amba_set_drvdata()
        watchdog: sirf: add watchdog driver of CSR SiRFprimaII and SiRFatlasVI
        watchdog: Remove redundant of_match_ptr
        watchdog: ts72xx_wdt: cleanup return codes in ioctl
        documentation/devicetree: Move DT bindings from gpio to watchdog
        watchdog: add ralink watchdog driver
        watchdog: Add MOXA ART watchdog driver
        ...
      27b5c3f3
    • L
      Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 13509c3a
      Linus Torvalds 提交于
      Pull i2c changes from Wolfram Sang:
       - new drivers for exynos5, bcm kona, and st micro
       - bigger overhauls for drivers mxs and rcar
       - typical driver bugfixes, cleanups, improvements
       - got rid of the superfluous 'driver' member in i2c_client struct This
         touches a few drivers in other subsystems.  All acked.
      
      * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (38 commits)
        i2c: bcm-kona: fix error return code in bcm_kona_i2c_probe()
        i2c: i2c-eg20t: do not print error message in syslog if no ACK received
        i2c: bcm-kona: Introduce Broadcom I2C Driver
        i2c: cbus-gpio: Fix device tree binding
        i2c: wmt: add missing clk_disable_unprepare() on error
        i2c: designware: add new ACPI IDs
        i2c: i801: Add Device IDs for Intel Wildcat Point-LP PCH
        i2c: exynos5: Remove incorrect clk_disable_unprepare
        i2c: i2c-st: Add ST I2C controller
        i2c: exynos5: add High Speed I2C controller driver
        i2c: rcar: fixup rcar type naming
        i2c: scmi: remove some bogus NULL checks
        i2c: sh_mobile & rcar: Enable the driver on all ARM platforms
        i2c: sh_mobile: Convert to clk_prepare/unprepare
        i2c: mux: gpio: use reg value for i2c_add_mux_adapter
        i2c: mux: gpio: use gpio_set_value_cansleep()
        i2c: Include linux/of.h header
        i2c: mxs: Fix PIO mode on i.MX23
        i2c: mxs: Rework the PIO mode operation
        i2c: mxs: distinguish i.MX23 and i.MX28 based I2C controller
        ...
      13509c3a
    • L
      Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband · 1ea406c0
      Linus Torvalds 提交于
      Pull infiniband/rdma updates from Roland Dreier:
       - Re-enable flow steering verbs with new improved userspace ABI
       - Fixes for slow connection due to GID lookup scalability
       - IPoIB fixes
       - Many fixes to HW drivers including mlx4, mlx5, ocrdma and qib
       - Further improvements to SRP error handling
       - Add new transport type for Cisco usNIC
      
      * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (66 commits)
        IB/core: Re-enable create_flow/destroy_flow uverbs
        IB/core: extended command: an improved infrastructure for uverbs commands
        IB/core: Remove ib_uverbs_flow_spec structure from userspace
        IB/core: Use a common header for uverbs flow_specs
        IB/core: Make uverbs flow structure use names like verbs ones
        IB/core: Rename 'flow' structs to match other uverbs structs
        IB/core: clarify overflow/underflow checks on ib_create/destroy_flow
        IB/ucma: Convert use of typedef ctl_table to struct ctl_table
        IB/cm: Convert to using idr_alloc_cyclic()
        IB/mlx5: Fix page shift in create CQ for userspace
        IB/mlx4: Fix device max capabilities check
        IB/mlx5: Fix list_del of empty list
        IB/mlx5: Remove dead code
        IB/core: Encorce MR access rights rules on kernel consumers
        IB/mlx4: Fix endless loop in resize CQ
        RDMA/cma: Remove unused argument and minor dead code
        RDMA/ucma: Discard events for IDs not yet claimed by user space
        IB/core: Add Cisco usNIC rdma node and transport types
        RDMA/nes: Remove self-assignment from nes_query_qp()
        IB/srp: Report receive errors correctly
        ...
      1ea406c0
    • L
      Merge tag 'for-v3.13' of git://git.infradead.org/battery-2.6 · a709bd58
      Linus Torvalds 提交于
      Pull battery updates from Anton Vorontsov:
       "Highlights:
         - A new driver for TI BQ24735 Battery Chargers, courtesy of NVidia.
         - Device tree bindings for TWL4030 chips.
         - Random fixes and cleanups"
      
      * tag 'for-v3.13' of git://git.infradead.org/battery-2.6:
        pm2301-charger: Remove unneeded NULL checks
        twl4030_charger: Add devicetree support
        power_supply: Fix documentation for TEMP_*ALERT* properties
        max17042_battery: Support regmap to access device's registers
        max17042_battery: Use SIMPLE_DEV_PM_OPS
        charger-manager : Replace kzalloc to devm_kzalloc and remove uneccessary code
        bq2415x_charger: Fix max battery regulation voltage
        tps65090-charger: Use "IS_ENABLED(CONFIG_OF)" for DT code
        tps65090-charger: Drop devm_free_irq of devm_ allocated irq
        power_supply: Add support for bq24735 charger
        pm2301-charger: Staticize pm2xxx_charger_die_therm_mngt
        pm2301-charger: Check return value of regulator_enable
        ab8500-charger: Remove redundant break
        ab8500-charger: Check return value of regulator_enable
        isp1704_charger: Fix driver to work with changes introduced in v3.5
      a709bd58