diff options
Diffstat (limited to 'kernel/trace/trace_syscalls.c')
-rw-r--r-- | kernel/trace/trace_syscalls.c | 195 |
1 files changed, 86 insertions, 109 deletions
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index ddee9c593732..57501d90096a 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -51,32 +51,6 @@ static struct syscall_metadata *syscall_nr_to_meta(int nr) | |||
51 | return syscalls_metadata[nr]; | 51 | return syscalls_metadata[nr]; |
52 | } | 52 | } |
53 | 53 | ||
54 | int syscall_name_to_nr(char *name) | ||
55 | { | ||
56 | int i; | ||
57 | |||
58 | if (!syscalls_metadata) | ||
59 | return -1; | ||
60 | |||
61 | for (i = 0; i < NR_syscalls; i++) { | ||
62 | if (syscalls_metadata[i]) { | ||
63 | if (!strcmp(syscalls_metadata[i]->name, name)) | ||
64 | return i; | ||
65 | } | ||
66 | } | ||
67 | return -1; | ||
68 | } | ||
69 | |||
70 | void set_syscall_enter_id(int num, int id) | ||
71 | { | ||
72 | syscalls_metadata[num]->enter_id = id; | ||
73 | } | ||
74 | |||
75 | void set_syscall_exit_id(int num, int id) | ||
76 | { | ||
77 | syscalls_metadata[num]->exit_id = id; | ||
78 | } | ||
79 | |||
80 | enum print_line_t | 54 | enum print_line_t |
81 | print_syscall_enter(struct trace_iterator *iter, int flags) | 55 | print_syscall_enter(struct trace_iterator *iter, int flags) |
82 | { | 56 | { |
@@ -93,7 +67,7 @@ print_syscall_enter(struct trace_iterator *iter, int flags) | |||
93 | if (!entry) | 67 | if (!entry) |
94 | goto end; | 68 | goto end; |
95 | 69 | ||
96 | if (entry->enter_id != ent->type) { | 70 | if (entry->enter_event->id != ent->type) { |
97 | WARN_ON_ONCE(1); | 71 | WARN_ON_ONCE(1); |
98 | goto end; | 72 | goto end; |
99 | } | 73 | } |
@@ -148,7 +122,7 @@ print_syscall_exit(struct trace_iterator *iter, int flags) | |||
148 | return TRACE_TYPE_HANDLED; | 122 | return TRACE_TYPE_HANDLED; |
149 | } | 123 | } |
150 | 124 | ||
151 | if (entry->exit_id != ent->type) { | 125 | if (entry->exit_event->id != ent->type) { |
152 | WARN_ON_ONCE(1); | 126 | WARN_ON_ONCE(1); |
153 | return TRACE_TYPE_UNHANDLED; | 127 | return TRACE_TYPE_UNHANDLED; |
154 | } | 128 | } |
@@ -166,24 +140,19 @@ extern char *__bad_type_size(void); | |||
166 | #define SYSCALL_FIELD(type, name) \ | 140 | #define SYSCALL_FIELD(type, name) \ |
167 | sizeof(type) != sizeof(trace.name) ? \ | 141 | sizeof(type) != sizeof(trace.name) ? \ |
168 | __bad_type_size() : \ | 142 | __bad_type_size() : \ |
169 | #type, #name, offsetof(typeof(trace), name), sizeof(trace.name) | 143 | #type, #name, offsetof(typeof(trace), name), \ |
144 | sizeof(trace.name), is_signed_type(type) | ||
170 | 145 | ||
171 | int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s) | 146 | int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s) |
172 | { | 147 | { |
173 | int i; | 148 | int i; |
174 | int nr; | ||
175 | int ret; | 149 | int ret; |
176 | struct syscall_metadata *entry; | 150 | struct syscall_metadata *entry = call->data; |
177 | struct syscall_trace_enter trace; | 151 | struct syscall_trace_enter trace; |
178 | int offset = offsetof(struct syscall_trace_enter, args); | 152 | int offset = offsetof(struct syscall_trace_enter, args); |
179 | 153 | ||
180 | nr = syscall_name_to_nr(call->data); | 154 | ret = trace_seq_printf(s, "\tfield:%s %s;\toffset:%zu;\tsize:%zu;" |
181 | entry = syscall_nr_to_meta(nr); | 155 | "\tsigned:%u;\n", |
182 | |||
183 | if (!entry) | ||
184 | return 0; | ||
185 | |||
186 | ret = trace_seq_printf(s, "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n", | ||
187 | SYSCALL_FIELD(int, nr)); | 156 | SYSCALL_FIELD(int, nr)); |
188 | if (!ret) | 157 | if (!ret) |
189 | return 0; | 158 | return 0; |
@@ -193,8 +162,10 @@ int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s) | |||
193 | entry->args[i]); | 162 | entry->args[i]); |
194 | if (!ret) | 163 | if (!ret) |
195 | return 0; | 164 | return 0; |
196 | ret = trace_seq_printf(s, "\toffset:%d;\tsize:%zu;\n", offset, | 165 | ret = trace_seq_printf(s, "\toffset:%d;\tsize:%zu;" |
197 | sizeof(unsigned long)); | 166 | "\tsigned:%u;\n", offset, |
167 | sizeof(unsigned long), | ||
168 | is_signed_type(unsigned long)); | ||
198 | if (!ret) | 169 | if (!ret) |
199 | return 0; | 170 | return 0; |
200 | offset += sizeof(unsigned long); | 171 | offset += sizeof(unsigned long); |
@@ -226,8 +197,10 @@ int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s) | |||
226 | struct syscall_trace_exit trace; | 197 | struct syscall_trace_exit trace; |
227 | 198 | ||
228 | ret = trace_seq_printf(s, | 199 | ret = trace_seq_printf(s, |
229 | "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" | 200 | "\tfield:%s %s;\toffset:%zu;\tsize:%zu;" |
230 | "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n", | 201 | "\tsigned:%u;\n" |
202 | "\tfield:%s %s;\toffset:%zu;\tsize:%zu;" | ||
203 | "\tsigned:%u;\n", | ||
231 | SYSCALL_FIELD(int, nr), | 204 | SYSCALL_FIELD(int, nr), |
232 | SYSCALL_FIELD(long, ret)); | 205 | SYSCALL_FIELD(long, ret)); |
233 | if (!ret) | 206 | if (!ret) |
@@ -239,22 +212,19 @@ int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s) | |||
239 | int syscall_enter_define_fields(struct ftrace_event_call *call) | 212 | int syscall_enter_define_fields(struct ftrace_event_call *call) |
240 | { | 213 | { |
241 | struct syscall_trace_enter trace; | 214 | struct syscall_trace_enter trace; |
242 | struct syscall_metadata *meta; | 215 | struct syscall_metadata *meta = call->data; |
243 | int ret; | 216 | int ret; |
244 | int nr; | ||
245 | int i; | 217 | int i; |
246 | int offset = offsetof(typeof(trace), args); | 218 | int offset = offsetof(typeof(trace), args); |
247 | 219 | ||
248 | nr = syscall_name_to_nr(call->data); | ||
249 | meta = syscall_nr_to_meta(nr); | ||
250 | |||
251 | if (!meta) | ||
252 | return 0; | ||
253 | |||
254 | ret = trace_define_common_fields(call); | 220 | ret = trace_define_common_fields(call); |
255 | if (ret) | 221 | if (ret) |
256 | return ret; | 222 | return ret; |
257 | 223 | ||
224 | ret = trace_define_field(call, SYSCALL_FIELD(int, nr), FILTER_OTHER); | ||
225 | if (ret) | ||
226 | return ret; | ||
227 | |||
258 | for (i = 0; i < meta->nb_args; i++) { | 228 | for (i = 0; i < meta->nb_args; i++) { |
259 | ret = trace_define_field(call, meta->types[i], | 229 | ret = trace_define_field(call, meta->types[i], |
260 | meta->args[i], offset, | 230 | meta->args[i], offset, |
@@ -275,7 +245,11 @@ int syscall_exit_define_fields(struct ftrace_event_call *call) | |||
275 | if (ret) | 245 | if (ret) |
276 | return ret; | 246 | return ret; |
277 | 247 | ||
278 | ret = trace_define_field(call, SYSCALL_FIELD(long, ret), 0, | 248 | ret = trace_define_field(call, SYSCALL_FIELD(int, nr), FILTER_OTHER); |
249 | if (ret) | ||
250 | return ret; | ||
251 | |||
252 | ret = trace_define_field(call, SYSCALL_FIELD(long, ret), | ||
279 | FILTER_OTHER); | 253 | FILTER_OTHER); |
280 | 254 | ||
281 | return ret; | 255 | return ret; |
@@ -302,8 +276,8 @@ void ftrace_syscall_enter(struct pt_regs *regs, long id) | |||
302 | 276 | ||
303 | size = sizeof(*entry) + sizeof(unsigned long) * sys_data->nb_args; | 277 | size = sizeof(*entry) + sizeof(unsigned long) * sys_data->nb_args; |
304 | 278 | ||
305 | event = trace_current_buffer_lock_reserve(&buffer, sys_data->enter_id, | 279 | event = trace_current_buffer_lock_reserve(&buffer, |
306 | size, 0, 0); | 280 | sys_data->enter_event->id, size, 0, 0); |
307 | if (!event) | 281 | if (!event) |
308 | return; | 282 | return; |
309 | 283 | ||
@@ -334,8 +308,8 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret) | |||
334 | if (!sys_data) | 308 | if (!sys_data) |
335 | return; | 309 | return; |
336 | 310 | ||
337 | event = trace_current_buffer_lock_reserve(&buffer, sys_data->exit_id, | 311 | event = trace_current_buffer_lock_reserve(&buffer, |
338 | sizeof(*entry), 0, 0); | 312 | sys_data->exit_event->id, sizeof(*entry), 0, 0); |
339 | if (!event) | 313 | if (!event) |
340 | return; | 314 | return; |
341 | 315 | ||
@@ -348,14 +322,12 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret) | |||
348 | trace_current_buffer_unlock_commit(buffer, event, 0, 0); | 322 | trace_current_buffer_unlock_commit(buffer, event, 0, 0); |
349 | } | 323 | } |
350 | 324 | ||
351 | int reg_event_syscall_enter(void *ptr) | 325 | int reg_event_syscall_enter(struct ftrace_event_call *call) |
352 | { | 326 | { |
353 | int ret = 0; | 327 | int ret = 0; |
354 | int num; | 328 | int num; |
355 | char *name; | ||
356 | 329 | ||
357 | name = (char *)ptr; | 330 | num = ((struct syscall_metadata *)call->data)->syscall_nr; |
358 | num = syscall_name_to_nr(name); | ||
359 | if (num < 0 || num >= NR_syscalls) | 331 | if (num < 0 || num >= NR_syscalls) |
360 | return -ENOSYS; | 332 | return -ENOSYS; |
361 | mutex_lock(&syscall_trace_lock); | 333 | mutex_lock(&syscall_trace_lock); |
@@ -372,13 +344,11 @@ int reg_event_syscall_enter(void *ptr) | |||
372 | return ret; | 344 | return ret; |
373 | } | 345 | } |
374 | 346 | ||
375 | void unreg_event_syscall_enter(void *ptr) | 347 | void unreg_event_syscall_enter(struct ftrace_event_call *call) |
376 | { | 348 | { |
377 | int num; | 349 | int num; |
378 | char *name; | ||
379 | 350 | ||
380 | name = (char *)ptr; | 351 | num = ((struct syscall_metadata *)call->data)->syscall_nr; |
381 | num = syscall_name_to_nr(name); | ||
382 | if (num < 0 || num >= NR_syscalls) | 352 | if (num < 0 || num >= NR_syscalls) |
383 | return; | 353 | return; |
384 | mutex_lock(&syscall_trace_lock); | 354 | mutex_lock(&syscall_trace_lock); |
@@ -389,14 +359,12 @@ void unreg_event_syscall_enter(void *ptr) | |||
389 | mutex_unlock(&syscall_trace_lock); | 359 | mutex_unlock(&syscall_trace_lock); |
390 | } | 360 | } |
391 | 361 | ||
392 | int reg_event_syscall_exit(void *ptr) | 362 | int reg_event_syscall_exit(struct ftrace_event_call *call) |
393 | { | 363 | { |
394 | int ret = 0; | 364 | int ret = 0; |
395 | int num; | 365 | int num; |
396 | char *name; | ||
397 | 366 | ||
398 | name = (char *)ptr; | 367 | num = ((struct syscall_metadata *)call->data)->syscall_nr; |
399 | num = syscall_name_to_nr(name); | ||
400 | if (num < 0 || num >= NR_syscalls) | 368 | if (num < 0 || num >= NR_syscalls) |
401 | return -ENOSYS; | 369 | return -ENOSYS; |
402 | mutex_lock(&syscall_trace_lock); | 370 | mutex_lock(&syscall_trace_lock); |
@@ -413,13 +381,11 @@ int reg_event_syscall_exit(void *ptr) | |||
413 | return ret; | 381 | return ret; |
414 | } | 382 | } |
415 | 383 | ||
416 | void unreg_event_syscall_exit(void *ptr) | 384 | void unreg_event_syscall_exit(struct ftrace_event_call *call) |
417 | { | 385 | { |
418 | int num; | 386 | int num; |
419 | char *name; | ||
420 | 387 | ||
421 | name = (char *)ptr; | 388 | num = ((struct syscall_metadata *)call->data)->syscall_nr; |
422 | num = syscall_name_to_nr(name); | ||
423 | if (num < 0 || num >= NR_syscalls) | 389 | if (num < 0 || num >= NR_syscalls) |
424 | return; | 390 | return; |
425 | mutex_lock(&syscall_trace_lock); | 391 | mutex_lock(&syscall_trace_lock); |
@@ -430,13 +396,17 @@ void unreg_event_syscall_exit(void *ptr) | |||
430 | mutex_unlock(&syscall_trace_lock); | 396 | mutex_unlock(&syscall_trace_lock); |
431 | } | 397 | } |
432 | 398 | ||
433 | struct trace_event event_syscall_enter = { | 399 | int init_syscall_trace(struct ftrace_event_call *call) |
434 | .trace = print_syscall_enter, | 400 | { |
435 | }; | 401 | int id; |
436 | 402 | ||
437 | struct trace_event event_syscall_exit = { | 403 | id = register_ftrace_event(call->event); |
438 | .trace = print_syscall_exit, | 404 | if (!id) |
439 | }; | 405 | return -ENODEV; |
406 | call->id = id; | ||
407 | INIT_LIST_HEAD(&call->fields); | ||
408 | return 0; | ||
409 | } | ||
440 | 410 | ||
441 | int __init init_ftrace_syscalls(void) | 411 | int __init init_ftrace_syscalls(void) |
442 | { | 412 | { |
@@ -454,6 +424,10 @@ int __init init_ftrace_syscalls(void) | |||
454 | for (i = 0; i < NR_syscalls; i++) { | 424 | for (i = 0; i < NR_syscalls; i++) { |
455 | addr = arch_syscall_addr(i); | 425 | addr = arch_syscall_addr(i); |
456 | meta = find_syscall_meta(addr); | 426 | meta = find_syscall_meta(addr); |
427 | if (!meta) | ||
428 | continue; | ||
429 | |||
430 | meta->syscall_nr = i; | ||
457 | syscalls_metadata[i] = meta; | 431 | syscalls_metadata[i] = meta; |
458 | } | 432 | } |
459 | 433 | ||
@@ -473,8 +447,10 @@ static void prof_syscall_enter(struct pt_regs *regs, long id) | |||
473 | struct syscall_metadata *sys_data; | 447 | struct syscall_metadata *sys_data; |
474 | struct syscall_trace_enter *rec; | 448 | struct syscall_trace_enter *rec; |
475 | unsigned long flags; | 449 | unsigned long flags; |
450 | char *trace_buf; | ||
476 | char *raw_data; | 451 | char *raw_data; |
477 | int syscall_nr; | 452 | int syscall_nr; |
453 | int rctx; | ||
478 | int size; | 454 | int size; |
479 | int cpu; | 455 | int cpu; |
480 | 456 | ||
@@ -498,41 +474,42 @@ static void prof_syscall_enter(struct pt_regs *regs, long id) | |||
498 | /* Protect the per cpu buffer, begin the rcu read side */ | 474 | /* Protect the per cpu buffer, begin the rcu read side */ |
499 | local_irq_save(flags); | 475 | local_irq_save(flags); |
500 | 476 | ||
477 | rctx = perf_swevent_get_recursion_context(); | ||
478 | if (rctx < 0) | ||
479 | goto end_recursion; | ||
480 | |||
501 | cpu = smp_processor_id(); | 481 | cpu = smp_processor_id(); |
502 | 482 | ||
503 | if (in_nmi()) | 483 | trace_buf = rcu_dereference(perf_trace_buf); |
504 | raw_data = rcu_dereference(trace_profile_buf_nmi); | ||
505 | else | ||
506 | raw_data = rcu_dereference(trace_profile_buf); | ||
507 | 484 | ||
508 | if (!raw_data) | 485 | if (!trace_buf) |
509 | goto end; | 486 | goto end; |
510 | 487 | ||
511 | raw_data = per_cpu_ptr(raw_data, cpu); | 488 | raw_data = per_cpu_ptr(trace_buf, cpu); |
512 | 489 | ||
513 | /* zero the dead bytes from align to not leak stack to user */ | 490 | /* zero the dead bytes from align to not leak stack to user */ |
514 | *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL; | 491 | *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL; |
515 | 492 | ||
516 | rec = (struct syscall_trace_enter *) raw_data; | 493 | rec = (struct syscall_trace_enter *) raw_data; |
517 | tracing_generic_entry_update(&rec->ent, 0, 0); | 494 | tracing_generic_entry_update(&rec->ent, 0, 0); |
518 | rec->ent.type = sys_data->enter_id; | 495 | rec->ent.type = sys_data->enter_event->id; |
519 | rec->nr = syscall_nr; | 496 | rec->nr = syscall_nr; |
520 | syscall_get_arguments(current, regs, 0, sys_data->nb_args, | 497 | syscall_get_arguments(current, regs, 0, sys_data->nb_args, |
521 | (unsigned long *)&rec->args); | 498 | (unsigned long *)&rec->args); |
522 | perf_tp_event(sys_data->enter_id, 0, 1, rec, size); | 499 | perf_tp_event(sys_data->enter_event->id, 0, 1, rec, size); |
523 | 500 | ||
524 | end: | 501 | end: |
502 | perf_swevent_put_recursion_context(rctx); | ||
503 | end_recursion: | ||
525 | local_irq_restore(flags); | 504 | local_irq_restore(flags); |
526 | } | 505 | } |
527 | 506 | ||
528 | int reg_prof_syscall_enter(char *name) | 507 | int prof_sysenter_enable(struct ftrace_event_call *call) |
529 | { | 508 | { |
530 | int ret = 0; | 509 | int ret = 0; |
531 | int num; | 510 | int num; |
532 | 511 | ||
533 | num = syscall_name_to_nr(name); | 512 | num = ((struct syscall_metadata *)call->data)->syscall_nr; |
534 | if (num < 0 || num >= NR_syscalls) | ||
535 | return -ENOSYS; | ||
536 | 513 | ||
537 | mutex_lock(&syscall_trace_lock); | 514 | mutex_lock(&syscall_trace_lock); |
538 | if (!sys_prof_refcount_enter) | 515 | if (!sys_prof_refcount_enter) |
@@ -548,13 +525,11 @@ int reg_prof_syscall_enter(char *name) | |||
548 | return ret; | 525 | return ret; |
549 | } | 526 | } |
550 | 527 | ||
551 | void unreg_prof_syscall_enter(char *name) | 528 | void prof_sysenter_disable(struct ftrace_event_call *call) |
552 | { | 529 | { |
553 | int num; | 530 | int num; |
554 | 531 | ||
555 | num = syscall_name_to_nr(name); | 532 | num = ((struct syscall_metadata *)call->data)->syscall_nr; |
556 | if (num < 0 || num >= NR_syscalls) | ||
557 | return; | ||
558 | 533 | ||
559 | mutex_lock(&syscall_trace_lock); | 534 | mutex_lock(&syscall_trace_lock); |
560 | sys_prof_refcount_enter--; | 535 | sys_prof_refcount_enter--; |
@@ -570,7 +545,9 @@ static void prof_syscall_exit(struct pt_regs *regs, long ret) | |||
570 | struct syscall_trace_exit *rec; | 545 | struct syscall_trace_exit *rec; |
571 | unsigned long flags; | 546 | unsigned long flags; |
572 | int syscall_nr; | 547 | int syscall_nr; |
548 | char *trace_buf; | ||
573 | char *raw_data; | 549 | char *raw_data; |
550 | int rctx; | ||
574 | int size; | 551 | int size; |
575 | int cpu; | 552 | int cpu; |
576 | 553 | ||
@@ -596,17 +573,19 @@ static void prof_syscall_exit(struct pt_regs *regs, long ret) | |||
596 | 573 | ||
597 | /* Protect the per cpu buffer, begin the rcu read side */ | 574 | /* Protect the per cpu buffer, begin the rcu read side */ |
598 | local_irq_save(flags); | 575 | local_irq_save(flags); |
576 | |||
577 | rctx = perf_swevent_get_recursion_context(); | ||
578 | if (rctx < 0) | ||
579 | goto end_recursion; | ||
580 | |||
599 | cpu = smp_processor_id(); | 581 | cpu = smp_processor_id(); |
600 | 582 | ||
601 | if (in_nmi()) | 583 | trace_buf = rcu_dereference(perf_trace_buf); |
602 | raw_data = rcu_dereference(trace_profile_buf_nmi); | ||
603 | else | ||
604 | raw_data = rcu_dereference(trace_profile_buf); | ||
605 | 584 | ||
606 | if (!raw_data) | 585 | if (!trace_buf) |
607 | goto end; | 586 | goto end; |
608 | 587 | ||
609 | raw_data = per_cpu_ptr(raw_data, cpu); | 588 | raw_data = per_cpu_ptr(trace_buf, cpu); |
610 | 589 | ||
611 | /* zero the dead bytes from align to not leak stack to user */ | 590 | /* zero the dead bytes from align to not leak stack to user */ |
612 | *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL; | 591 | *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL; |
@@ -614,24 +593,24 @@ static void prof_syscall_exit(struct pt_regs *regs, long ret) | |||
614 | rec = (struct syscall_trace_exit *)raw_data; | 593 | rec = (struct syscall_trace_exit *)raw_data; |
615 | 594 | ||
616 | tracing_generic_entry_update(&rec->ent, 0, 0); | 595 | tracing_generic_entry_update(&rec->ent, 0, 0); |
617 | rec->ent.type = sys_data->exit_id; | 596 | rec->ent.type = sys_data->exit_event->id; |
618 | rec->nr = syscall_nr; | 597 | rec->nr = syscall_nr; |
619 | rec->ret = syscall_get_return_value(current, regs); | 598 | rec->ret = syscall_get_return_value(current, regs); |
620 | 599 | ||
621 | perf_tp_event(sys_data->exit_id, 0, 1, rec, size); | 600 | perf_tp_event(sys_data->exit_event->id, 0, 1, rec, size); |
622 | 601 | ||
623 | end: | 602 | end: |
603 | perf_swevent_put_recursion_context(rctx); | ||
604 | end_recursion: | ||
624 | local_irq_restore(flags); | 605 | local_irq_restore(flags); |
625 | } | 606 | } |
626 | 607 | ||
627 | int reg_prof_syscall_exit(char *name) | 608 | int prof_sysexit_enable(struct ftrace_event_call *call) |
628 | { | 609 | { |
629 | int ret = 0; | 610 | int ret = 0; |
630 | int num; | 611 | int num; |
631 | 612 | ||
632 | num = syscall_name_to_nr(name); | 613 | num = ((struct syscall_metadata *)call->data)->syscall_nr; |
633 | if (num < 0 || num >= NR_syscalls) | ||
634 | return -ENOSYS; | ||
635 | 614 | ||
636 | mutex_lock(&syscall_trace_lock); | 615 | mutex_lock(&syscall_trace_lock); |
637 | if (!sys_prof_refcount_exit) | 616 | if (!sys_prof_refcount_exit) |
@@ -647,13 +626,11 @@ int reg_prof_syscall_exit(char *name) | |||
647 | return ret; | 626 | return ret; |
648 | } | 627 | } |
649 | 628 | ||
650 | void unreg_prof_syscall_exit(char *name) | 629 | void prof_sysexit_disable(struct ftrace_event_call *call) |
651 | { | 630 | { |
652 | int num; | 631 | int num; |
653 | 632 | ||
654 | num = syscall_name_to_nr(name); | 633 | num = ((struct syscall_metadata *)call->data)->syscall_nr; |
655 | if (num < 0 || num >= NR_syscalls) | ||
656 | return; | ||
657 | 634 | ||
658 | mutex_lock(&syscall_trace_lock); | 635 | mutex_lock(&syscall_trace_lock); |
659 | sys_prof_refcount_exit--; | 636 | sys_prof_refcount_exit--; |