kernel_optimize_test/tools/perf/tests
Adrian Hunter e39a12cbd2 perf tests: Add a test for time-utils
Test time ranges work as expected.

Committer testing:

  $ perf test "time utils"
  59: time utils                                            : Ok
  $ perf test -v "time utils"
  59: time utils                                            :
  --- start ---
  test child forked, pid 31711

  parse_nsec_time("0")
  0

  parse_nsec_time("1")
  1000000000

  parse_nsec_time("0.000000001")
  1

  parse_nsec_time("1.000000001")
  1000000001

  parse_nsec_time("123456.123456")
  123456123456000

  parse_nsec_time("1234567.123456789")
  1234567123456789

  parse_nsec_time("18446744073.709551615")
  18446744073709551615

  perf_time__parse_str("1234567.123456789,1234567.123456789")
  start time 1234567123456789, end time 1234567123456789

  perf_time__parse_str("1234567.123456789,1234567.123456790")
  start time 1234567123456789, end time 1234567123456790

  perf_time__parse_str("1234567.123456789,")
  start time 1234567123456789, end time 0

  perf_time__parse_str(",1234567.123456789")
  start time 0, end time 1234567123456789

  perf_time__parse_str("0,1234567.123456789")
  start time 0, end time 1234567123456789

  perf_time__parse_for_ranges("1234567.123456789,1234567.123456790")
  start time 1234567123456789, end time 1234567123456790

  perf_time__parse_for_ranges("10%/1")
  first_sample_time 7654321000000000 last_sample_time 7654321000000100
  start time 0: 7654321000000000, end time 0: 7654321000000009

  perf_time__parse_for_ranges("10%/2")
  first_sample_time 7654321000000000 last_sample_time 7654321000000100
  start time 0: 7654321000000010, end time 0: 7654321000000019

  perf_time__parse_for_ranges("10%/1,10%/2")
  first_sample_time 11223344000000000 last_sample_time 11223344000000100
  start time 0: 11223344000000000, end time 0: 11223344000000009
  start time 1: 11223344000000010, end time 1: 11223344000000019

  perf_time__parse_for_ranges("10%/1,10%/3,10%/10")
  first_sample_time 11223344000000000 last_sample_time 11223344000000100
  start time 0: 11223344000000000, end time 0: 11223344000000009
  start time 1: 11223344000000020, end time 1: 11223344000000029
  start time 2: 11223344000000090, end time 2: 11223344000000100

  test child finished with 0
  ---- end ----
  time utils: Ok
  $

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190604130017.31207-19-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-06-10 16:20:12 -03:00
..
attr perf tools: Save bpf_prog_info and BTF of new BPF programs 2019-03-21 11:27:04 -03:00
shell perf test zstd: Fixup verbose mode output 2019-05-15 16:36:49 -03:00
.gitignore
attr.c perf tools: Fix diverse comment typos 2018-12-17 14:56:47 -03:00
attr.py perf script python: Add Python3 support to tests/attr.py 2019-02-05 10:31:08 -03:00
backward-ring-buffer.c perf tools: Fix errors under optimization level '-Og' 2019-03-19 16:52:04 -03:00
bitmap.c perf tools: Drop unneeded bitmap_zero() calls 2018-08-08 15:55:44 -03:00
bp_account.c perf tools: Remove duplicate headers 2019-01-21 15:15:57 -03:00
bp_signal_overflow.c
bp_signal.c perf tests ARM: Disable breakpoint tests 32-bit 2018-12-17 14:56:27 -03:00
bpf-script-example.c
bpf-script-test-kbuild.c
bpf-script-test-prologue.c
bpf-script-test-relocation.c
bpf.c
Build perf tests: Add a test for time-utils 2019-06-10 16:20:12 -03:00
builtin-test.c perf tests: Add a test for time-utils 2019-06-10 16:20:12 -03:00
clang.c
code-reading.c perf tools: Add missing include for symbols.h 2019-02-06 10:00:38 -03:00
cpumap.c
dso-data.c perf test: Fix spelling mistake "leadking" -> "leaking" 2019-05-15 16:36:46 -03:00
dwarf-unwind.c perf tools: Add missing include for symbols.h 2019-02-06 10:00:38 -03:00
event_update.c
event-times.c
evsel-roundtrip-name.c
evsel-tp-sched.c perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() 2019-03-19 16:52:06 -03:00
expr.c perf tests: Fix memory leak by expr__find_other() in test__expr() 2019-03-19 16:52:05 -03:00
fdarray.c
hists_common.c pref tools: Add missing map.h includes 2019-02-06 10:00:38 -03:00
hists_common.h
hists_cumulate.c pref tools: Add missing map.h includes 2019-02-06 10:00:38 -03:00
hists_filter.c pref tools: Add missing map.h includes 2019-02-06 10:00:38 -03:00
hists_link.c perf hist: Use cached rbtrees 2019-01-25 15:12:10 +01:00
hists_output.c pref tools: Add missing map.h includes 2019-02-06 10:00:38 -03:00
is_printable_array.c
keep-tracking.c
kmod-path.c perf tools: Remove ext from struct kmod_path 2018-08-20 08:54:59 -03:00
llvm.c
llvm.h
make perf build tests: Add NO_LIBZSTD=1 to make_minimal 2019-05-15 16:36:49 -03:00
map_groups.c perf tests: Add map_groups__merge_in test 2019-05-28 18:37:44 -03:00
mem.c
mem2node.c perf tools: Drop unneeded bitmap_zero() calls 2018-08-08 15:55:44 -03:00
mmap-basic.c
mmap-thread-lookup.c pref tools: Add missing map.h includes 2019-02-06 10:00:38 -03:00
openat-syscall-all-cpus.c perf tests: Fix a memory leak of cpu_map object in the openat_syscall_event_on_all_cpus test 2019-03-19 16:52:05 -03:00
openat-syscall-tp-fields.c
openat-syscall.c
parse-events.c perf tools: Fix legacy events symbol separator parsing 2019-02-14 15:18:08 -03:00
parse-no-sample-id-all.c
perf-hooks.c
perf-record.c perf tests record: Allow for 'sleep' being 'coreutils' 2018-12-17 14:54:26 -03:00
perf-targz-src-pkg
pmu.c perf tests pmu: Add missing headers 2019-02-06 10:00:38 -03:00
python-use.c perf test: Use header file util/debug.h 2018-06-04 10:28:53 -03:00
sample-parsing.c perf tests: Add missing headers so far obtained indirectly 2019-02-06 10:00:38 -03:00
sdt.c perf tests: Add missing headers so far obtained indirectly 2019-02-06 10:00:38 -03:00
stat.c
sw-clock.c
switch-tracking.c
task-exit.c
tests.h perf tests: Add a test for time-utils 2019-06-10 16:20:12 -03:00
thread-map.c
thread-mg-share.c
time-utils-test.c perf tests: Add a test for time-utils 2019-06-10 16:20:12 -03:00
topology.c perf test session topology: Fix test on s390 2018-06-25 11:59:35 -03:00
unit_number__scnprintf.c
vmlinux-kallsyms.c perf test vmlinux-kallsyms: Ignore aliases to _etext when searching on kallsyms 2019-05-28 09:52:23 -03:00
wp.c perf test: S390 does not support watchpoints in test 22 2018-10-08 14:23:44 -03:00