Skip to contentSkip to conversation

Hardware Breakpoint interfaces

PATCH In review K.Prasad 2 participants 4 messages May 13, 2009 – May 14, 2009

lore
Share & tools
lore

K.Prasad

author
#0 lore raw

cover Hardware Breakpoint interfaces

Hi Alan,
Please find a new set of patches with the following changes.
I am eager to know if you think that they are ready for submission towards upstream acceptance.

Hi Frederic,
Please find the changes in ftrace plugin code that moves the
startup selftest code completely into trace_selftest_startup_ksym() as per your suggestion.

Changelog
---------

- A new interface modify_user_hw_breakpoint() to change the characteristics (such as type/length) of a pre-registered user-space breakpoint is introduced.

- The startup selftest portion of code from ksym_trace_init() is moved completely to trace_selftest_startup_ksym(). process_new_ksym_entry() is required during the selftest and is no longer marked static.

- HB_NUM is renamed to HBP_NUM (given that the short naming convention for hw_breakpoint is hbp).

Thanks,
K.Prasad

#1 lore raw
Quoted 4 lines · K.Prasad

Hi Alan,
Please find a new set of patches with the following changes.
I am eager to know if you think that they are ready for submission towards upstream acceptance.

This is looking pretty good. Only one thing caught my eye:
switch_to_thread_hw_breakpoint and switch_to_none_hw_breakpoint do nothing but call the corresponding arch-specific routines. You might as well eliminate them and have the callers invoke the arch-specific routines instead.

Alan Stern

author
#2 lore raw
Quoted 7 lines · Alan Stern
Quoted 4 lines · K.Prasad

Hi Alan,
Please find a new set of patches with the following changes.
I am eager to know if you think that they are ready for submission towards upstream acceptance.

Quoted 8 lines

This is looking pretty good. Only one thing caught my eye:
switch_to_thread_hw_breakpoint and switch_to_none_hw_breakpoint do nothing but call the corresponding arch-specific routines. You might as well eliminate them and have the callers invoke the arch-specific routines instead.

Alan Stern

Sure. I will eliminate the above two functions and also remove the msleep() call in ftrace startup selftest code path.

With these two changes I plan to submit the code for -tip acceptance directly.

I wish to thank you profusely for the in-depth code reviews, suggestions, unearthing corner-case issues and the immense time and effort taken for the same. The patch wouldn't have been as better but for your involvement!

Thanks,
K.Prasad

author
#3 lore raw
Quoted 14 lines · K.Prasad
Quoted 13 lines · Alan Stern
Quoted 4 lines · K.Prasad

Hi Alan,
Please find a new set of patches with the following changes.
I am eager to know if you think that they are ready for submission towards upstream acceptance.

This is looking pretty good. Only one thing caught my eye:
switch_to_thread_hw_breakpoint and switch_to_none_hw_breakpoint do nothing but call the corresponding arch-specific routines. You might as well eliminate them and have the callers invoke the arch-specific routines instead.

Quoted 9 lines
Quoted 2 lines

Alan Stern

Sure. I will eliminate the above two functions and also remove the msleep() call in ftrace startup selftest code path.

With these two changes I plan to submit the code for -tip acceptance directly.

There is another change that I wanted to make in arch_store_info() [which I realised while responding to comments on another list]. I think it will be much safer to add a check to see if symbol_name is passed when user-space breakpoints are requested and return -EINVAL if done so.

This will help avoid any confusion at the user, who can assume that symbol names can be resolved, and specifying address is not required.

Here's how the modified arch_store_info() would look like:

/*
* Store a breakpoint's encoded address, length, and type.
*/
static int arch_store_info(struct hw_breakpoint *bp, struct task_struct *tsk)

{
	/*
	 * User-space requests will always have the address field populated.
	 * Symbol names from user-space are rejected
	 */
	if (tsk && bp->info.name)
		return -EINVAL;
	/*
	 * For kernel-addresses, either the address or symbol name can be
	 * specified.
	 */
	if (bp->info.name)
		bp->info.address = (unsigned long)
					kallsyms_lookup_name(bp->info.name);
	if (bp->info.address)
		return 0;
	return -EINVAL;
}

Thanks,
K.Prasad