lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1102211409480.2701@localhost6.localdomain6>
Date:	Mon, 21 Feb 2011 14:18:04 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Stanislaw Gruszka <sgruszka@...hat.com>
cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] debugobjects: print more data

On Mon, 21 Feb 2011, Stanislaw Gruszka wrote:
> diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h
> index 597692f..c22eebf 100644
> --- a/include/linux/debugobjects.h
> +++ b/include/linux/debugobjects.h
> @@ -31,10 +31,11 @@ struct debug_obj {
>  	void			*object;
>  	struct debug_obj_descr	*descr;
>  };
> -

Stray whitespace change

>  /**
>   * struct debug_obj_descr - object type specific debug description structure
> + *
>   * @name:		name of the object typee
> + * @print:		function printing extra debug data
>   * @fixup_init:		fixup function, which is called when the init check
>   *			fails
>   * @fixup_activate:	fixup function, which is called when the activate check
> @@ -46,7 +47,7 @@ struct debug_obj {
>   */
>  struct debug_obj_descr {
>  	const char		*name;
> -
> +	void (*print)		(struct debug_obj *obj);
>  	int (*fixup_init)	(void *addr, enum debug_obj_state state);
>  	int (*fixup_activate)	(void *addr, enum debug_obj_state state);
>  	int (*fixup_destroy)	(void *addr, enum debug_obj_state state);
> @@ -73,6 +74,8 @@ debug_object_active_state(void *addr, struct debug_obj_descr *descr,
>  
>  extern void debug_objects_early_init(void);
>  extern void debug_objects_mem_init(void);
> +
> +extern char *debug_func_str(void *func_addr);

Uuurgh.

> +void hrtimer_debug_print(struct debug_obj *obj)
> +{
> +	struct hrtimer *hrtimer = obj->object;
> +
> +	if (hrtimer == NULL)
> +		return;

Why should obj->object be NULL. Also why not having the same calling
convention as all other functions (void *addr) ?

> +
> +	printk(KERN_ERR "ODEBUG hrtimer: %p function: [<%p>] %s\n",
> +	       hrtimer, hrtimer->function, debug_func_str(hrtimer->function));

Why do you want to invent a new function for printing the symbol? %ps perhaps?

> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 2b97418..1e901b0 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -276,6 +276,7 @@ config TIMER_STATS
>  config DEBUG_OBJECTS
>  	bool "Debug object operations"
>  	depends on DEBUG_KERNEL
> +	select KALLSYMS

No, we don't want to have DEBUG_OBJECTS tied to KALLSYMS.

> +char *debug_func_str(void *func_addr)
> +{
> +	static char func_str[KSYM_SYMBOL_LEN];
> +	sprint_symbol(func_str, (unsigned long) func_addr);
> +	
> +	return func_str;
> +}

See above.

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ