- first_empty = MAX_TRACES;
- /* Try to find the trace */
- for(i=0;i<MAX_TRACES;i++) {
- if(i<first_empty && !lttng_trace_info[i].channel.cpu.start)
- first_empty = i;
- if(cpu_addr ==
- (unsigned long)lttng_trace_info[i].channel.cpu.start &&
- fac_addr ==
- (unsigned long)lttng_trace_info[i].channel.facilities.start) {
- /* Found */
- lttng_trace_info[i].filter = filter;
- lttng_trace_info[i].active = active;
- lttng_trace_info[i].destroy = destroy;
- if(destroy && !atomic_read(<tng_trace_info[i].nesting)) {
- lttng_free_trace_info(<tng_trace_info[i]);
- }
- break;
- }
-
- }
- if(i == MAX_TRACES) {
+ info = find_info(cpu_addr, fac_addr, &first_empty);
+ if(info) {
+ info->filter = filter;
+ info->active = active;
+ info->destroy = destroy;
+ if(destroy && !atomic_read(&info->nesting))
+ lttng_free_trace_info(info);
+ } else {