diff options
author | Joel Fernandes <joelaf@google.com> | 2017-06-14 12:30:31 +0100 |
---|---|---|
committer | KP Singh <kpsingh@google.com> | 2017-06-15 00:18:51 +0200 |
commit | 658d4cc50a81cc0234bd4cdb3fa87f38782223b1 (patch) | |
tree | c91bac6521ae1f3358d40ca0fa51d1f561f11c21 /tests | |
parent | 750f7187a8d0ad2d72a0261261bc9a7d81fbae93 (diff) | |
download | trappy-658d4cc50a81cc0234bd4cdb3fa87f38782223b1.tar.gz |
trappy/ftrace: add a line number column
Useful for joining DataFrames that have timestamp collisions or for
iterating through a group of DataFrames in line order.
Signed-off-by: Joel Fernandes <joelaf@google.com>
Reviewed-by: KP Singh <kpsingh@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_base.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_base.py b/tests/test_base.py index c186ecc..3311f11 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -85,7 +85,7 @@ class TestBase(utils_tests.SetupDirectory): in_data = """ kworker/4:1-397 [004] 720.741315: thermal_power_cpu_get: cpus=000000f0 freq=1900000 raw_cpu_power=1259 load={} power=61 kworker/4:1-397 [004] 720.741349: thermal_power_cpu_get: cpus=0000000f freq=1400000 raw_cpu_power=189 load={} power=14""" - expected_columns = set(["__comm", "__pid", "__cpu", "cpus", "freq", + expected_columns = set(["__comm", "__pid", "__cpu", "__line", "cpus", "freq", "raw_cpu_power", "power"]) with open("trace.txt", "w") as fout: @@ -121,7 +121,7 @@ class TestBase(utils_tests.SetupDirectory): timestamp ) - expected_columns = set(["__comm", "__pid", "__cpu", "tag"]) + expected_columns = set(["__comm", "__pid", "__cpu", "__line", "tag"]) with open("trace.txt", "w") as fout: fout.write(in_data) @@ -145,7 +145,7 @@ class TestBase(utils_tests.SetupDirectory): in_data = """ rcu_preempt-7 [000] 73.604532: my_sched_stat_runtime: comm=Space separated taskname pid=7 runtime=262875 [ns] vruntime=17096359856 [ns]""" - expected_columns = set(["__comm", "__pid", "__cpu", "comm", "pid", "runtime", "vruntime"]) + expected_columns = set(["__comm", "__pid", "__cpu", "__line", "comm", "pid", "runtime", "vruntime"]) with open("trace.txt", "w") as fout: fout.write(in_data) @@ -209,7 +209,7 @@ class TestBase(utils_tests.SetupDirectory): df = trace.equals_event.data_frame self.assertSetEqual(set(df.columns), - set(["__comm", "__pid", "__cpu", "my_field"])) + set(["__comm", "__pid", "__cpu", "__line", "my_field"])) self.assertListEqual(df["my_field"].tolist(), ["foo", "foo=bar", "foo=bar=baz", 1, "1=2", "1=foo", "1foo=2"]) |