)]}'
{
  "commit": "6331c28c962561aee59e5a493b7556a4bb585957",
  "tree": "33292a3127aa831ee8ec2394e790bc2a8817beee",
  "parents": [
    "072126f4529196f71a97960248bca54fd4554c2d"
  ],
  "author": {
    "name": "Steven Rostedt",
    "email": "srostedt@redhat.com",
    "time": "Wed Jul 13 15:11:02 2011 -0400"
  },
  "committer": {
    "name": "Steven Rostedt",
    "email": "rostedt@goodmis.org",
    "time": "Wed Jul 13 22:25:09 2011 -0400"
  },
  "message": "ftrace: Fix dynamic selftest failure on some archs\n\nArchs that do not implement CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST, will\nfail the dynamic ftrace selftest.\n\nThe function tracer has a quick \u0027off\u0027 variable that will prevent\nthe call back functions from being called. This variable is called\nfunction_trace_stop. In x86, this is implemented directly in the mcount\nassembly, but for other archs, an intermediate function is used called\nftrace_test_stop_func().\n\nIn dynamic ftrace, the function pointer variable ftrace_trace_function is\nused to update the caller code in the mcount caller. But for archs that\ndo not have CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST set, it only calls\nftrace_test_stop_func() instead, which in turn calls __ftrace_trace_function.\n\nWhen more than one ftrace_ops is registered, the function it calls is\nftrace_ops_list_func(), which will iterate over all registered ftrace_ops\nand call the callbacks that have their hash matching.\n\nThe issue happens when two ftrace_ops are registered for different functions\nand one is then unregistered. The __ftrace_trace_function is then pointed\nto the remaining ftrace_ops callback function directly. This mean it will\nbe called for all functions that were registered to trace by both ftrace_ops\nthat were registered.\n\nThis is not an issue for archs with CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST,\nbecause the update of ftrace_trace_function doesn\u0027t happen until after all\nfunctions have been updated, and then the mcount caller is updated. But\nfor those archs that do use the ftrace_test_stop_func(), the update is\nimmediate.\n\nThe dynamic selftest fails because it hits this situation, and the\nftrace_ops that it registers fails to only trace what it was suppose to\nand instead traces all other functions.\n\nThe solution is to delay the setting of __ftrace_trace_function until\nafter all the functions have been updated according to the registered\nftrace_ops. Also, function_trace_stop is set during the update to prevent\nfunction tracing from calling code that is caused by the function tracer\nitself.\n\nSigned-off-by: Steven Rostedt \u003crostedt@goodmis.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a0dc0de8d6491b017c62e9f65e3bfa37074ec604",
      "old_mode": 33188,
      "old_path": "kernel/trace/ftrace.c",
      "new_id": "62e26d930535118aa78439d0d7118e0126acfe7b",
      "new_mode": 33188,
      "new_path": "kernel/trace/ftrace.c"
    }
  ]
}
