)]}'
{
  "commit": "da4d03020c2af32f73e8bfbab0a66620d85bb9bb",
  "tree": "3ee6d7d69754df7910454315a6011c14d8664d01",
  "parents": [
    "9cc26a261d43e5898287a1f5808132f8f05ceb1c"
  ],
  "author": {
    "name": "Steven Rostedt",
    "email": "srostedt@redhat.com",
    "time": "Mon Mar 09 17:14:30 2009 -0400"
  },
  "committer": {
    "name": "Steven Rostedt",
    "email": "srostedt@redhat.com",
    "time": "Tue Mar 10 00:35:07 2009 -0400"
  },
  "message": "tracing: new format for specialized trace points\n\nImpact: clean up and enhancement\n\nThe TRACE_EVENT_FORMAT macro looks quite ugly and is limited in its\nability to save data as well as to print the record out. Working with\nIngo Molnar, we came up with a new format that is much more pleasing to\nthe eye of C developers. This new macro is more C style than the old\nmacro, and is more obvious to what it does.\n\nHere\u0027s the example. The only updated macro in this patch is the\nsched_switch trace point.\n\nThe old method looked like this:\n\n TRACE_EVENT_FORMAT(sched_switch,\n        TP_PROTO(struct rq *rq, struct task_struct *prev,\n                struct task_struct *next),\n        TP_ARGS(rq, prev, next),\n        TP_FMT(\"task %s:%d \u003d\u003d\u003e %s:%d\",\n              prev-\u003ecomm, prev-\u003epid, next-\u003ecomm, next-\u003epid),\n        TRACE_STRUCT(\n                TRACE_FIELD(pid_t, prev_pid, prev-\u003epid)\n                TRACE_FIELD(int, prev_prio, prev-\u003eprio)\n                TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN],\n                                    next_comm,\n                                    TP_CMD(memcpy(TRACE_ENTRY-\u003enext_comm,\n                                                 next-\u003ecomm,\n                                                 TASK_COMM_LEN)))\n                TRACE_FIELD(pid_t, next_pid, next-\u003epid)\n                TRACE_FIELD(int, next_prio, next-\u003eprio)\n        ),\n        TP_RAW_FMT(\"prev %d:%d \u003d\u003d\u003e next %s:%d:%d\")\n        );\n\nThe above method is hard to read and requires two format fields.\n\nThe new method:\n\n /*\n  * Tracepoint for task switches, performed by the scheduler:\n  *\n  * (NOTE: the \u0027rq\u0027 argument is not used by generic trace events,\n  *        but used by the latency tracer plugin. )\n  */\n TRACE_EVENT(sched_switch,\n\n\tTP_PROTO(struct rq *rq, struct task_struct *prev,\n\t\t struct task_struct *next),\n\n\tTP_ARGS(rq, prev, next),\n\n\tTP_STRUCT__entry(\n\t\t__array(\tchar,\tprev_comm,\tTASK_COMM_LEN\t)\n\t\t__field(\tpid_t,\tprev_pid\t\t\t)\n\t\t__field(\tint,\tprev_prio\t\t\t)\n\t\t__array(\tchar,\tnext_comm,\tTASK_COMM_LEN\t)\n\t\t__field(\tpid_t,\tnext_pid\t\t\t)\n\t\t__field(\tint,\tnext_prio\t\t\t)\n\t),\n\n\tTP_printk(\"task %s:%d [%d] \u003d\u003d\u003e %s:%d [%d]\",\n\t\t__entry-\u003eprev_comm, __entry-\u003eprev_pid, __entry-\u003eprev_prio,\n\t\t__entry-\u003enext_comm, __entry-\u003enext_pid, __entry-\u003enext_prio),\n\n\tTP_fast_assign(\n\t\tmemcpy(__entry-\u003enext_comm, next-\u003ecomm, TASK_COMM_LEN);\n\t\t__entry-\u003eprev_pid\t\u003d prev-\u003epid;\n\t\t__entry-\u003eprev_prio\t\u003d prev-\u003eprio;\n\t\tmemcpy(__entry-\u003eprev_comm, prev-\u003ecomm, TASK_COMM_LEN);\n\t\t__entry-\u003enext_pid\t\u003d next-\u003epid;\n\t\t__entry-\u003enext_prio\t\u003d next-\u003eprio;\n\t)\n );\n\nThis macro is called TRACE_EVENT, it is broken up into 5 parts:\n\n TP_PROTO:        the proto type of the trace point\n TP_ARGS:         the arguments of the trace point\n TP_STRUCT_entry: the structure layout of the entry in the ring buffer\n TP_printk:       the printk format\n TP_fast_assign:  the method used to write the entry into the ring buffer\n\nThe structure is the definition of how the event will be saved in the\nring buffer. The printk is used by the internal tracing in case of\nan oops, and the kernel needs to print out the format of the record\nto the console. This the TP_printk gives a means to show the records\nin a human readable format. It is also used to print out the data\nfrom the trace file.\n\nThe TP_fast_assign is executed directly. It is basically like a C function,\nwhere the __entry is the handle to the record.\n\nSigned-off-by: Steven Rostedt \u003csrostedt@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3bcc3e171443552cf7f0988e06ac35d3abb43af8",
      "old_mode": 33188,
      "old_path": "include/linux/tracepoint.h",
      "new_id": "6b4f1bb3701e877cd90c2cd47e3c00b4001d2f7d",
      "new_mode": 33188,
      "new_path": "include/linux/tracepoint.h"
    },
    {
      "type": "modify",
      "old_id": "71b14828a95734be29c6c8575f1bd3c49075ecdb",
      "old_mode": 33188,
      "old_path": "include/trace/sched_event_types.h",
      "new_id": "aa77fb7540386cae54c2ccffb4b2d8d3885758ad",
      "new_mode": 33188,
      "new_path": "include/trace/sched_event_types.h"
    },
    {
      "type": "modify",
      "old_id": "2bfb7d11fc176a41b3a41da3e9f215c7b4835b24",
      "old_mode": 33188,
      "old_path": "kernel/trace/trace.h",
      "new_id": "c5e1d8865fe4d2d4036dd886f447cbf737b45de7",
      "new_mode": 33188,
      "new_path": "kernel/trace/trace.h"
    },
    {
      "type": "modify",
      "old_id": "d94179aa1fc22b851cf0b983d0ed7f73c22ae82a",
      "old_mode": 33188,
      "old_path": "kernel/trace/trace_event_types.h",
      "new_id": "5cca4c978bde06a80274446b879a57d97ce8671c",
      "new_mode": 33188,
      "new_path": "kernel/trace/trace_event_types.h"
    },
    {
      "type": "modify",
      "old_id": "fa32ca32076743534725602a2fb95f82d7eb9253",
      "old_mode": 33188,
      "old_path": "kernel/trace/trace_events.c",
      "new_id": "1880a643809785a173fa5709169f26c3c268851d",
      "new_mode": 33188,
      "new_path": "kernel/trace/trace_events.c"
    },
    {
      "type": "modify",
      "old_id": "3830a731424c01a49a1edd01eb62b9fcb3a20c69",
      "old_mode": 33188,
      "old_path": "kernel/trace/trace_events_stage_1.h",
      "new_id": "edfcbd3a0d1bd7b9838042aa38e4f17de4ea1281",
      "new_mode": 33188,
      "new_path": "kernel/trace/trace_events_stage_1.h"
    },
    {
      "type": "modify",
      "old_id": "8e2e0f56c2a8dbacef365fba0d77203fd78ae004",
      "old_mode": 33188,
      "old_path": "kernel/trace/trace_events_stage_2.h",
      "new_id": "d91bf4c566613eaebd8b403edceb3b947fe9ea00",
      "new_mode": 33188,
      "new_path": "kernel/trace/trace_events_stage_2.h"
    },
    {
      "type": "modify",
      "old_id": "41b82b93c9c71814f64000f907451d3e6adc5e83",
      "old_mode": 33188,
      "old_path": "kernel/trace/trace_events_stage_3.h",
      "new_id": "8e398d864096d443986437c282d3c48a49ea6c9c",
      "new_mode": 33188,
      "new_path": "kernel/trace/trace_events_stage_3.h"
    },
    {
      "type": "modify",
      "old_id": "e62bc10f810325a471c47ad6feb786616caee98f",
      "old_mode": 33188,
      "old_path": "kernel/trace/trace_export.c",
      "new_id": "23ae78430d589412f9a7eec6f8809f20caab2f56",
      "new_mode": 33188,
      "new_path": "kernel/trace/trace_export.c"
    }
  ]
}
