mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] debugobjects: print more data
Date: Mon, 21 Feb 2011 14:18:04 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.1102211409480.2701@localhost6.localdomain6> (raw)
In-Reply-To: <20110221112440.GA5140@redhat.com>

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

      reply	other threads:[~2011-02-21 13:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 11:24 Stanislaw Gruszka
2011-02-21 13:18 ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.1102211409480.2701@localhost6.localdomain6 \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sgruszka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®