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

Side by Side Diff: third_party/tcmalloc/chromium/src/tests/profiler_unittest.cc

Issue 9416072: Fix gperftools to not arm the profiling timer by default. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 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 | « third_party/tcmalloc/chromium/src/tests/profile-handler_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2005, Google Inc. 1 // Copyright (c) 2005, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 int i, m; 57 int i, m;
58 char b[128]; 58 char b[128];
59 MutexLock ml(&mutex); 59 MutexLock ml(&mutex);
60 for (m = 0; m < 1000000; ++m) { // run millions of times 60 for (m = 0; m < 1000000; ++m) { // run millions of times
61 for (i = 0; i < g_iters; ++i ) { 61 for (i = 0; i < g_iters; ++i ) {
62 result ^= i; 62 result ^= i;
63 } 63 }
64 snprintf(b, sizeof(b), "other: %d", result); // get some libc action 64 snprintf(b, sizeof(b), "other: %d", result); // get some libc action
65 } 65 }
66
67 ProfilerUnregisterThread();
66 #endif 68 #endif
67 } 69 }
68 70
69 static void test_main_thread() { 71 static void test_main_thread() {
70 int i, m; 72 int i, m;
71 char b[128]; 73 char b[128];
72 MutexLock ml(&mutex); 74 MutexLock ml(&mutex);
73 for (m = 0; m < 1000000; ++m) { // run millions of times 75 for (m = 0; m < 1000000; ++m) { // run millions of times
74 for (i = 0; i < g_iters; ++i ) { 76 for (i = 0; i < g_iters; ++i ) {
75 result ^= i; 77 result ^= i;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 #endif 135 #endif
134 136
135 test_main_thread(); 137 test_main_thread();
136 138
137 if (filename) { 139 if (filename) {
138 ProfilerStop(); 140 ProfilerStop();
139 } 141 }
140 142
141 return 0; 143 return 0;
142 } 144 }
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/tests/profile-handler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698