Skip to content

Instantly share code, notes, and snippets.

@JoelMarcey
Created November 20, 2014 20:59
Show Gist options
  • Save JoelMarcey/d09bb2fffdc954f25627 to your computer and use it in GitHub Desktop.
Save JoelMarcey/d09bb2fffdc954f25627 to your computer and use it in GitHub Desktop.
Hardware Profile
% hhvm -g --hdf Eval.ProfileHWEnable=true test.php
:
:
Breakpoint 7, HPHP::HardwareCounter::HardwareCounter (this=0x7fffee224dc0)
at hphp/runtime/base/hardware-counter.cpp:182
182 : m_countersSet(false) {
(gdb) p RuntimeOption::EvalProfileHWEnable
$2 = true
----
hhvm -g --hdf Eval.ProfileHWEnable=false test.php
Breakpoint 6, HPHP::HardwareCounter::HardwareCounter (this=0x7fffee224dc0)
at hphp/runtime/base/hardware-counter.cpp:182
182 : m_countersSet(false) {
(gdb) p RuntimeOption::EvalProfileHWEnable
$1 = false
-----
and hphp_process_init() which starts looking at hardware counters is done *after* the RuntimeOptions are bound.
(gdb) bt
#0 HPHP::HardwareCounter::HardwareCounter (this=0x7fffee224dc0)
at hphp/runtime/base/hardware-counter.cpp:182
#1 0x0000000008768b1b in HPHP::ThreadLocalNoCheck<HPHP::HardwareCounter>::create (
this=0x7ffff7fe91e8) at hphp/util/thread-local.h:252
#2 0x000000000876889c in HPHP::ThreadLocalNoCheck<HPHP::HardwareCounter>::getCheck (
this=0x7ffff7fe91e8) at hphp/util/thread-local.h:257
#3 0x00000000087686f1 in HPHP::init_thread_locals (arg=0x0)
at hphp/runtime/base/thread-init-fini.cpp:66
#4 0x00000000087c59f8 in HPHP::hphp_process_init ()
at hphp/runtime/base/program-functions.cpp:1632
#5 0x00000000087c4065 in HPHP::execute_program_impl (argc=18, argv=0x7fffffffd8c8)
at hphp/runtime/base/program-functions.cpp:1431
#6 0x00000000087c11b7 in HPHP::execute_program (argc=18, argv=0x7fffffffd8c8)
at hphp/runtime/base/program-functions.cpp:941
---Type <return> to continue, or q <return> to quit---
#7 0x0000000007373e03 in main (argc=18, argv=0x7fffffffd8c8) at hphp/hhvm/main.cpp:61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment