@@ -427,16 +427,9 @@ EXPORT_SYMBOL_GPL(register_user_hw_breakpoint);
427
427
* modify_user_hw_breakpoint - modify a user-space hardware breakpoint
428
428
* @bp: the breakpoint structure to modify
429
429
* @attr: new breakpoint attributes
430
- * @triggered: callback to trigger when we hit the breakpoint
431
- * @tsk: pointer to 'task_struct' of the process to which the address belongs
432
430
*/
433
431
int modify_user_hw_breakpoint (struct perf_event * bp , struct perf_event_attr * attr )
434
432
{
435
- u64 old_addr = bp -> attr .bp_addr ;
436
- u64 old_len = bp -> attr .bp_len ;
437
- int old_type = bp -> attr .bp_type ;
438
- int err = 0 ;
439
-
440
433
/*
441
434
* modify_user_hw_breakpoint can be invoked with IRQs disabled and hence it
442
435
* will not be possible to raise IPIs that invoke __perf_event_disable.
@@ -451,27 +444,18 @@ int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *att
451
444
bp -> attr .bp_addr = attr -> bp_addr ;
452
445
bp -> attr .bp_type = attr -> bp_type ;
453
446
bp -> attr .bp_len = attr -> bp_len ;
447
+ bp -> attr .disabled = 1 ;
454
448
455
- if (attr -> disabled )
456
- goto end ;
457
-
458
- err = validate_hw_breakpoint (bp );
459
- if (!err )
460
- perf_event_enable (bp );
449
+ if (!attr -> disabled ) {
450
+ int err = validate_hw_breakpoint (bp );
461
451
462
- if (err ) {
463
- bp -> attr .bp_addr = old_addr ;
464
- bp -> attr .bp_type = old_type ;
465
- bp -> attr .bp_len = old_len ;
466
- if (!bp -> attr .disabled )
467
- perf_event_enable (bp );
452
+ if (err )
453
+ return err ;
468
454
469
- return err ;
455
+ perf_event_enable (bp );
456
+ bp -> attr .disabled = 0 ;
470
457
}
471
458
472
- end :
473
- bp -> attr .disabled = attr -> disabled ;
474
-
475
459
return 0 ;
476
460
}
477
461
EXPORT_SYMBOL_GPL (modify_user_hw_breakpoint );
0 commit comments