forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux…
…/kernel/git/acme/linux into perf/core Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: New features: - Allow using trace events fields as sort order keys, making 'perf evlist --trace_fields' show those, and then the user can select a subset and use like: perf top -e sched:sched_switch -s prev_comm,next_comm That works as well in 'perf report' when handling files containing tracepoints. The default when just tracepoint events are found in a perf.data file is to format it like ftrace, using the libtraceevent formatters, plugins, etc (Namhyung Kim) - Add support in 'perf script' to process 'perf stat record' generated files, culminating in a python perf script that calculates CPI (Cycles per Instruction) (Jiri Olsa) - Show random perf tool tips in the 'perf report' bottom line (Namhyung Kim) - perf report now defaults to --group if the perf.data file has grouped events, try it with: # perf record -e '{cycles,instructions}' -a sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 1.093 MB perf.data (1247 samples) ] # perf report # Samples: 1K of event 'anon group { cycles, instructions }' # Event count (approx.): 1955219195 # # Overhead Command Shared Object Symbol 2.86% 0.22% swapper [kernel.kallsyms] [k] intel_idle 1.05% 0.33% firefox libxul.so [.] js::SetObjectElement 1.05% 0.00% kworker/0:3 [kernel.kallsyms] [k] gen6_ring_get_seqno 0.88% 0.17% chrome chrome [.] 0x0000000000ee27ab 0.65% 0.86% firefox libxul.so [.] js::ValueToId<(js::AllowGC)1> 0.64% 0.23% JS Helper libxul.so [.] js::SplayTree<js::jit::LiveRange*, js::jit::LiveRange>::splay 0.62% 1.27% firefox libxul.so [.] js::GetIterator 0.61% 1.74% firefox libxul.so [.] js::NativeSetProperty 0.61% 0.31% firefox libxul.so [.] js::SetPropertyByDefining User visible fixes: - Coect data mmaps so that the DWARF unwinder can handle usecases needing them, like softice (Jiri Olsa) - Decay callchains in fractal mode, fixing up cases where 'perf top -g' would show entries with more than 100% (Namhyung Kim) Infrastructure changes: - Sync tools/lib with the lib/ in the kernel sources for find_bit.c and move bitmap.[ch] from tools/perf/util/ to tools/lib/ (Arnaldo Carvalho de Melo) - No need to set attr.sample_freq in some 'perf test' entries that only want to deal with PERF_RECORD_ meta-events, improve a bit error output for CQM test (Arnaldo Carvalho de Melo) - Fix python binding build, adding some missing object files now required due to cpumap using find_bit stuff (Arnaldo Carvalho de Melo) - tools/build improvemnts (Jiri Olsa) - Add more files to cscope/ctags databases (Jiri Olsa) - Do not show 'trace' in 'perf help' if it is not compiled in (Jiri Olsa) - Make perf_evlist__open() open evsels with their cpus and threads, like perf record does, making them consistent (Adrian Hunter) - Fix pmu snapshot initialization bug (Stephane Eranian) - Add missing headers in perf's MANIFEST (Wang Nan) Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
- Loading branch information
Showing
65 changed files
with
1,556 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* bit search implementation | ||
* | ||
* Copied from lib/find_bit.c to tools/lib/find_bit.c | ||
* | ||
* Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. | ||
* Written by David Howells ([email protected]) | ||
* | ||
* Copyright (C) 2008 IBM Corporation | ||
* 'find_last_bit' is written by Rusty Russell <[email protected]> | ||
* (Inspired by David Howell's find_next_bit implementation) | ||
* | ||
* Rewritten by Yury Norov <[email protected]> to decrease | ||
* size and improve performance, 2015. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version | ||
* 2 of the License, or (at your option) any later version. | ||
*/ | ||
|
||
#include <linux/bitops.h> | ||
#include <linux/bitmap.h> | ||
#include <linux/kernel.h> | ||
|
||
#if !defined(find_next_bit) | ||
|
||
/* | ||
* This is a common helper function for find_next_bit and | ||
* find_next_zero_bit. The difference is the "invert" argument, which | ||
* is XORed with each fetched word before searching it for one bits. | ||
*/ | ||
static unsigned long _find_next_bit(const unsigned long *addr, | ||
unsigned long nbits, unsigned long start, unsigned long invert) | ||
{ | ||
unsigned long tmp; | ||
|
||
if (!nbits || start >= nbits) | ||
return nbits; | ||
|
||
tmp = addr[start / BITS_PER_LONG] ^ invert; | ||
|
||
/* Handle 1st word. */ | ||
tmp &= BITMAP_FIRST_WORD_MASK(start); | ||
start = round_down(start, BITS_PER_LONG); | ||
|
||
while (!tmp) { | ||
start += BITS_PER_LONG; | ||
if (start >= nbits) | ||
return nbits; | ||
|
||
tmp = addr[start / BITS_PER_LONG] ^ invert; | ||
} | ||
|
||
return min(start + __ffs(tmp), nbits); | ||
} | ||
#endif | ||
|
||
#ifndef find_next_bit | ||
/* | ||
* Find the next set bit in a memory region. | ||
*/ | ||
unsigned long find_next_bit(const unsigned long *addr, unsigned long size, | ||
unsigned long offset) | ||
{ | ||
return _find_next_bit(addr, size, offset, 0UL); | ||
} | ||
#endif | ||
|
||
#ifndef find_first_bit | ||
/* | ||
* Find the first set bit in a memory region. | ||
*/ | ||
unsigned long find_first_bit(const unsigned long *addr, unsigned long size) | ||
{ | ||
unsigned long idx; | ||
|
||
for (idx = 0; idx * BITS_PER_LONG < size; idx++) { | ||
if (addr[idx]) | ||
return min(idx * BITS_PER_LONG + __ffs(addr[idx]), size); | ||
} | ||
|
||
return size; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.