Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(644)

Side by Side Diff: tools/cygprofile/mergetraces_unittest.py

Issue 281093002: Make cygprofile order functions by process and thread ID. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unnecessary assignment Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/cygprofile/mergetraces.py ('k') | tools/cygprofile/run_tests » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import unittest
6
7 import mergetraces
8
9 class GroupByProcessAndThreadIdTest(unittest.TestCase):
10 def runTest(self):
11 # (sec, usec, 'pid:tid', function address).
12 input_trace = [
13 (100, 10, '2000:2001', 0x5),
14 (100, 11, '2000:2001', 0x3),
15 (100, 11, '2000:2000', 0x1),
16 (100, 12, '2001:2001', 0x6),
17 (100, 13, '2000:2002', 0x8),
18 (100, 13, '2001:2002', 0x9),
19 (100, 14, '2000:2000', 0x7)
20 ]
21
22 # Functions should be grouped by thread-id and PIDs should not be
23 # interleaved.
24 expected_trace = [
25 (100, 10, '2000:2001', 0x5),
26 (100, 11, '2000:2001', 0x3),
27 (100, 11, '2000:2000', 0x1),
28 (100, 14, '2000:2000', 0x7),
29 (100, 13, '2000:2002', 0x8),
30 (100, 12, '2001:2001', 0x6),
31 (100, 13, '2001:2002', 0x9)
32 ]
33
34 grouped_trace = mergetraces.GroupByProcessAndThreadId(input_trace)
35
36 self.assertEqual(grouped_trace, expected_trace)
OLDNEW
« no previous file with comments | « tools/cygprofile/mergetraces.py ('k') | tools/cygprofile/run_tests » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698