)]}'
{
  "commit": "b625b3b3b740e177a1148594cd3ad5ff52f35315",
  "tree": "ae47ed49c18b46a0a12521307b411ca8f53028f4",
  "parents": [
    "7f33f9c5cc3c99aeaf4d266a7ed502b828115a53"
  ],
  "author": {
    "name": "Frederic Weisbecker",
    "email": "fweisbec@gmail.com",
    "time": "Sun Dec 06 00:52:56 2009 +0100"
  },
  "committer": {
    "name": "Frederic Weisbecker",
    "email": "fweisbec@gmail.com",
    "time": "Sun Dec 06 08:27:22 2009 +0100"
  },
  "message": "x86: Fixup wrong debug exception frame link in stacktraces\n\nWhile dumping a stacktrace, the end of the exception stack won\u0027t link\nthe frame pointer to the previous stack.\n\nThe interrupted stack will then be considered as unreliable and ignored\nby perf, as the frame pointer is unreliable itself.\n\nThis happens because we overwrite the frame pointer that links to the\ninterrupted frame with the address of the exception stack. This is\ndone in order to reserve space inside.\nBut rbp has been chosen here only because it is not a scratch register,\nso that the address of the exception stack remains in rbp after calling\ndo_debug(), we can then release the exception stack space without the\nneed to retrieve its address again.\n\nBut we can pick another non-scratch register to do that, so that we\npreserve the link to the interrupted stack frame in the stacktraces.\n\nJust randomly choose r12. Every registers are saved just before and\nrestored just after calling do_debug(). And r12 is not used in the\nmiddle, which makes it a perfect candidate.\n\nExample: perf record -g -a -c 1 -f -e mem:$(tasklist_lock_addr):rw\n\nBefore:\n    44.18%  [k] _raw_read_lock\n            |\n            |\n            ---  |--6.31%-- waitid\n                 |\n                 |--4.26%-- writev\n                 |\n                 |--3.63%-- __select\n                 |\n                 |--3.15%-- __waitpid\n                 |          |\n                 |          |--28.57%-- 0x8b52e00000139f\n                 |          |\n                 |          |--28.57%-- 0x8b52e0000013c6\n                 |          |\n                 |          |--14.29%-- 0x7fde786dc000\n                 |          |\n                 |          |--14.29%-- 0x62696c2f7273752f\n                 |          |\n                 |           --14.29%-- 0x1ea9df800000000\n                 |\n                 |--3.00%-- __poll\n\nAfter:\n\n    43.94%  [k] _raw_read_lock\n            |\n            --- _read_lock\n               |\n               |--60.53%-- send_sigio\n               |          __kill_fasync\n               |          kill_fasync\n               |          evdev_pass_event\n               |          evdev_event\n               |          input_pass_event\n               |          input_handle_event\n               |          input_event\n               |          synaptics_process_byte\n               |          psmouse_handle_byte\n               |          psmouse_interrupt\n               |          serio_interrupt\n               |          i8042_interrupt\n               |          handle_IRQ_event\n               |          handle_edge_irq\n               |          handle_irq\n               |          __irqentry_text_start\n               |          ret_from_intr\n               |          |\n               |          |--30.43%-- __select\n               |          |\n               |          |--17.39%-- 0x454f15\n               |          |\n               |          |--13.04%-- __read\n               |          |\n               |          |--13.04%-- vread_hpet\n               |          |\n               |          |--13.04%-- _xcb_lock_io\n               |          |\n               |           --13.04%-- 0x7f630878ce87\n\nNote: it does not only affect perf events but also other stacktraces in\nx86-64. They were considered as unreliable once we quit the debug\nstack frame.\n\nSigned-off-by: Frederic Weisbecker \u003cfweisbec@gmail.com\u003e\nCc: Peter Zijlstra \u003cpeterz@infradead.org\u003e\nCc: Paul Mackerras \u003cpaulus@samba.org\u003e\nCc: Arnaldo Carvalho de Melo \u003cacme@redhat.com\u003e\nCc: \"K. Prasad\" \u003cprasad@linux.vnet.ibm.com\u003e\nCc: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nCc: \"H. Peter Anvin\" \u003chpa@zytor.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "722df1b1152d57721568ef583e4f2c002922979b",
      "old_mode": 33188,
      "old_path": "arch/x86/kernel/entry_64.S",
      "new_id": "0f08a0cea3e0026cc578a8f67d947b772f8cfeb2",
      "new_mode": 33188,
      "new_path": "arch/x86/kernel/entry_64.S"
    }
  ]
}
