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

Side by Side Diff: src/platform-linux.cc

Issue 10908122: Add support for running low level profiler on Android. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments. Created 8 years, 3 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 | « src/flag-definitions.h ('k') | src/platform-openbsd.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 c = getc(fp); 505 c = getc(fp);
506 } while ((c != EOF) && (c != '\n')); 506 } while ((c != EOF) && (c != '\n'));
507 if (c == EOF) break; 507 if (c == EOF) break;
508 } 508 }
509 } 509 }
510 free(lib_name); 510 free(lib_name);
511 fclose(fp); 511 fclose(fp);
512 } 512 }
513 513
514 514
515 static const char kGCFakeMmap[] = "/tmp/__v8_gc__";
516
517
518 void OS::SignalCodeMovingGC() { 515 void OS::SignalCodeMovingGC() {
519 // Support for ll_prof.py. 516 // Support for ll_prof.py.
520 // 517 //
521 // The Linux profiler built into the kernel logs all mmap's with 518 // The Linux profiler built into the kernel logs all mmap's with
522 // PROT_EXEC so that analysis tools can properly attribute ticks. We 519 // PROT_EXEC so that analysis tools can properly attribute ticks. We
523 // do a mmap with a name known by ll_prof.py and immediately munmap 520 // do a mmap with a name known by ll_prof.py and immediately munmap
524 // it. This injects a GC marker into the stream of events generated 521 // it. This injects a GC marker into the stream of events generated
525 // by the kernel and allows us to synchronize V8 code log and the 522 // by the kernel and allows us to synchronize V8 code log and the
526 // kernel log. 523 // kernel log.
527 int size = sysconf(_SC_PAGESIZE); 524 int size = sysconf(_SC_PAGESIZE);
528 FILE* f = fopen(kGCFakeMmap, "w+"); 525 FILE* f = fopen(FLAG_gc_fake_mmap, "w+");
529 void* addr = mmap(OS::GetRandomMmapAddr(), 526 void* addr = mmap(OS::GetRandomMmapAddr(),
530 size, 527 size,
531 PROT_READ | PROT_EXEC, 528 PROT_READ | PROT_EXEC,
532 MAP_PRIVATE, 529 MAP_PRIVATE,
533 fileno(f), 530 fileno(f),
534 0); 531 0);
535 ASSERT(addr != MAP_FAILED); 532 ASSERT(addr != MAP_FAILED);
536 OS::Free(addr, size); 533 OS::Free(addr, size);
537 fclose(f); 534 fclose(f);
538 } 535 }
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 1287
1291 1288
1292 void Sampler::Stop() { 1289 void Sampler::Stop() {
1293 ASSERT(IsActive()); 1290 ASSERT(IsActive());
1294 SignalSender::RemoveActiveSampler(this); 1291 SignalSender::RemoveActiveSampler(this);
1295 SetActive(false); 1292 SetActive(false);
1296 } 1293 }
1297 1294
1298 1295
1299 } } // namespace v8::internal 1296 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/platform-openbsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698