> > I said this before, do not add global variables like this: > > static void print_item( client_context *cctx, const client_item *item ) > { > switch_event switch_event; > event_header_extended event_header_extended; > char item_data_str[256]; > FILE **f = cctx->event_streams; > > + static size_t event_counter = 1; > + static uint8_t prev_comm[16]; > + static int32_t prev_tid; > + static uint32_t cpu_id; > + static uint64_t ns; > > Move all your state to client_context. I said also that you have to > create the sched_switch event per CPU. > Have made changes.
https://github.com/rmeena840/rtems-tools/commit/a9e7c343188f2b5dcf2dded0f6b407bcdbcdced3 Have a look. Babeltrace output: babeltrace . | head [19:16:31.179109789] (+?.?????????) Record_Item sched_switch: { cpu_id = 0 }, { prev_comm = "", prev_tid = 0, prev_prio = 0, prev_state = 0, next_comm = "00001ce0", next_tid = 7392, next_prio = 0 } [19:16:31.180096211] (+0.000986422) Record_Item sched_switch: { cpu_id = 17 }, { prev_comm = "0a01002b", prev_tid = 167837739, prev_prio = 0, prev_state = 0, next_comm = "0a01002b", next_tid = 167837739, next_prio = 0 } [19:16:31.180116542] (+0.000020331) Record_Item sched_switch: { cpu_id = 17 }, { prev_comm = "0a01002b", prev_tid = 167837739, prev_prio = 0, prev_state = 0, next_comm = "09010014", next_tid = 151060500, next_prio = 0 } [19:16:31.180116542] (+0.000000000) Record_Item sched_switch: { cpu_id = 17 }, { prev_comm = "09010014", prev_tid = 151060500, prev_prio = 0, prev_state = 0, next_comm = "00001ce0", next_tid = 7392, next_prio = 0 } [19:16:31.180154588] (+0.000038046) Record_Item sched_switch: { cpu_id = 17 }, { prev_comm = "00001ce0", prev_tid = 7392, prev_prio = 0, prev_state = 0, next_comm = "0a01002b", next_tid = 167837739, next_prio = 0 } [19:16:31.180174232] (+0.000019644) Record_Item sched_switch: { cpu_id = 17 }, { prev_comm = "0a01002b", prev_tid = 167837739, prev_prio = 0, prev_state = 0, next_comm = "09010014", next_tid = 151060500, next_prio = 0 } [19:16:31.180174232] (+0.000000000) Record_Item sched_switch: { cpu_id = 17 }, { prev_comm = "09010014", prev_tid = 151060500, prev_prio = 0, prev_state = 0, next_comm = "09010015", next_tid = 151060501, next_prio = 0 } [19:16:31.180208594] (+0.000034362) Record_Item sched_switch: { cpu_id = 5 }, { prev_comm = "09010015", prev_tid = 151060501, prev_prio = 0, prev_state = 0, next_comm = "00001ce0", next_tid = 7392, next_prio = 0 } [19:16:31.180223920] (+0.000015326) Record_Item sched_switch: { cpu_id = 5 }, { prev_comm = "00001ce0", prev_tid = 7392, prev_prio = 0, prev_state = 0, next_comm = "0a01002b", next_tid = 167837739, next_prio = 0 } [19:16:31.180241405] (+0.000017485) Record_Item sched_switch: { cpu_id = 5 }, { prev_comm = "0a01002b", prev_tid = 167837739, prev_prio = 0, prev_state = 0, next_comm = "09010015", next_tid = 151060501, next_prio = 0 } -- *Ravindra Kumar Meena*, B. Tech. Computer Science and Engineering, Indian Institute of Technology (Indian School of Mines) <https://www.iitism.ac.in/>, Dhanbad
_______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel