History log of /linux-master/tools/perf/tests/time-utils-test.c
Revision Date Author Comments
# 33f44bfd 04-Nov-2021 Ian Rogers <irogers@google.com>

perf test: Rename struct test to test_suite

This is to align with kunit's terminology.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: Daniel Latypov <dlatypov@google.com>
Cc: David Gow <davidgow@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20211104064208.3156807-6-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# d68f0365 04-Nov-2021 Ian Rogers <irogers@google.com>

perf test: Move each test suite struct to its test

Rather than export test functions, export the test struct. Rename with a
suite__ prefix to avoid name collisions.

Committer notes:

Its '&suite__vectors_page', not '&suite__vectors_pages', noticed when
cross building to arm (32-bit).

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: Daniel Latypov <dlatypov@google.com>
Cc: David Gow <davidgow@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20211104064208.3156807-5-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 63503dba 21-Jul-2019 Jiri Olsa <jolsa@kernel.org>

perf evlist: Rename struct perf_evlist to struct evlist

Rename struct perf_evlist to struct evlist, so we don't have a name
clash when we add struct perf_evlist in libperf.

Committer notes:

Added fixes to build on arm64, from Jiri and from me
(tools/perf/util/cs-etm.c)

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190721112506.12306-6-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# a77a05e2 04-Jun-2019 Adrian Hunter <adrian.hunter@intel.com>

perf time-utils: Add support for multiple explicit time intervals

Currently only a single explicit time range is accepted. Add support for
multiple ranges separated by spaces, which requires the string to be
quoted. Update the time utils test accordingly.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190604130017.31207-20-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# e39a12cb 04-Jun-2019 Adrian Hunter <adrian.hunter@intel.com>

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>