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

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

Issue 9667026: Revert 126020 - Experiment for updating the tcmalloc chromium branch to r144 (gperftools 2.0). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
OLDNEW
1 // Copyright (c) 2008, Google Inc. 1 // Copyright (c) 2008, 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 23 matching lines...) Expand all
34 // by doing a bunch of allocations and then calling those functions. 34 // by doing a bunch of allocations and then calling those functions.
35 // A driver shell-script can call this, and then call pprof, and 35 // A driver shell-script can call this, and then call pprof, and
36 // verify the expected output. The output is written to 36 // verify the expected output. The output is written to
37 // argv[1].heap and argv[1].growth 37 // argv[1].heap and argv[1].growth
38 38
39 #include "config_for_unittests.h" 39 #include "config_for_unittests.h"
40 #include <stdio.h> 40 #include <stdio.h>
41 #include <stdlib.h> 41 #include <stdlib.h>
42 #include <string> 42 #include <string>
43 #include "base/logging.h" 43 #include "base/logging.h"
44 #include <gperftools/malloc_extension.h> 44 #include <google/malloc_extension.h>
45 45
46 using std::string; 46 using std::string;
47 47
48 extern "C" void* AllocateAllocate() ATTRIBUTE_NOINLINE; 48 extern "C" void* AllocateAllocate() ATTRIBUTE_NOINLINE;
49 49
50 extern "C" void* AllocateAllocate() { 50 extern "C" void* AllocateAllocate() {
51 // The VLOG's are mostly to discourage inlining 51 // The VLOG's are mostly to discourage inlining
52 VLOG(1, "Allocating some more"); 52 VLOG(1, "Allocating some more");
53 void* p = malloc(10000); 53 void* p = malloc(10000);
54 VLOG(1, "Done allocating"); 54 VLOG(1, "Done allocating");
(...skipping 18 matching lines...) Expand all
73 string s; 73 string s;
74 MallocExtension::instance()->GetHeapSample(&s); 74 MallocExtension::instance()->GetHeapSample(&s);
75 WriteStringToFile(s, string(argv[1]) + ".heap"); 75 WriteStringToFile(s, string(argv[1]) + ".heap");
76 76
77 s.clear(); 77 s.clear();
78 MallocExtension::instance()->GetHeapGrowthStacks(&s); 78 MallocExtension::instance()->GetHeapGrowthStacks(&s);
79 WriteStringToFile(s, string(argv[1]) + ".growth"); 79 WriteStringToFile(s, string(argv[1]) + ".growth");
80 80
81 return 0; 81 return 0;
82 } 82 }
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/tests/sampler_test.cc ('k') | third_party/tcmalloc/chromium/src/tests/simple_compat_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698