~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to include/linux/dynamic_debug.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef _DYNAMIC_DEBUG_H
2
2
#define _DYNAMIC_DEBUG_H
3
3
 
4
 
#include <linux/jump_label.h>
5
 
 
6
4
/* dynamic_printk_enabled, and dynamic_printk_enabled2 are bitmasks in which
7
5
 * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They
8
6
 * use independent hash functions, to reduce the chance of false positives.
31
29
         * writes commands to <debugfs>/dynamic_debug/control
32
30
         */
33
31
#define _DPRINTK_FLAGS_PRINT   (1<<0)  /* printk() a message using the format */
 
32
#define _DPRINTK_FLAGS_INCL_MODNAME     (1<<1)
 
33
#define _DPRINTK_FLAGS_INCL_FUNCNAME    (1<<2)
 
34
#define _DPRINTK_FLAGS_INCL_LINENO      (1<<3)
 
35
#define _DPRINTK_FLAGS_INCL_TID         (1<<4)
34
36
#define _DPRINTK_FLAGS_DEFAULT 0
35
37
        unsigned int flags:8;
36
38
        char enabled;
42
44
 
43
45
#if defined(CONFIG_DYNAMIC_DEBUG)
44
46
extern int ddebug_remove_module(const char *mod_name);
 
47
extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
 
48
        __attribute__ ((format (printf, 2, 3)));
45
49
 
46
50
#define dynamic_pr_debug(fmt, ...) do {                                 \
47
51
        static struct _ddebug descriptor                                \
50
54
        { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__,            \
51
55
                _DPRINTK_FLAGS_DEFAULT };                               \
52
56
        if (unlikely(descriptor.enabled))                               \
53
 
                printk(KERN_DEBUG pr_fmt(fmt),  ##__VA_ARGS__);         \
 
57
                __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \
54
58
        } while (0)
55
59
 
56
60