mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: Disable trace_printk use by default
trace_printk() does an extra stringify operation before calling do_trace_printk(). The string ends up unused. This has an impact to kernel even if we never end up using trace_printk(). Disable use of trace_printk() and introduce a Kconfig option for re-enabling it. Change-Id: I2e1014f5231f2089d7dc3cb2539e3eb5f4d58361 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1295298 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
707ea45e0f
commit
d6ff5ef649
@@ -111,6 +111,14 @@ config GK20A_PCI
|
||||
help
|
||||
Enable support for GPUs on PCIe bus.
|
||||
|
||||
config GK20A_TRACE_PRINTK
|
||||
bool "Support trace_printk debugging"
|
||||
depends on CONFIG_FTRACE_PRINTK
|
||||
default n
|
||||
help
|
||||
Enable nvgpu debug facility to redirect debug spew to ftrace. This
|
||||
affects kernel memory use, so should not be enabled by default.
|
||||
|
||||
config GK20A_VIDMEM
|
||||
bool "Support separate video memory on nvgpu"
|
||||
depends on GK20A
|
||||
|
||||
@@ -417,9 +417,10 @@ void gk20a_debug_init(struct device *dev, const char *debugfs_symlink)
|
||||
debugfs_create_bool("disable_syncpoints", S_IRUGO|S_IWUSR,
|
||||
platform->debugfs, &platform->disable_syncpoints);
|
||||
|
||||
#if defined(GK20A_DEBUG)
|
||||
debugfs_create_u32("dbg_mask", S_IRUGO|S_IWUSR,
|
||||
platform->debugfs, &gk20a_dbg_mask);
|
||||
|
||||
#ifdef CONFIG_GK20A_TRACE_PRINTK
|
||||
debugfs_create_u32("dbg_ftrace", S_IRUGO|S_IWUSR,
|
||||
platform->debugfs, &gk20a_dbg_ftrace);
|
||||
#endif
|
||||
|
||||
@@ -89,8 +89,8 @@
|
||||
|
||||
#define GK20A_NUM_CDEVS 7
|
||||
|
||||
#if defined(GK20A_DEBUG)
|
||||
u32 gk20a_dbg_mask = GK20A_DEFAULT_DBG_MASK;
|
||||
#ifdef CONFIG_GK20A_TRACE_PRINTK
|
||||
u32 gk20a_dbg_ftrace;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1108,12 +1108,10 @@ struct gk20a_cyclestate_buffer_elem {
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
/* debug info, default is compiled-in but effectively disabled (0 mask) */
|
||||
#define GK20A_DEBUG
|
||||
/*e.g: echo 1 > /d/gk20a.0/dbg_mask */
|
||||
#define GK20A_DEFAULT_DBG_MASK 0
|
||||
#else
|
||||
/* manually enable and turn it on the mask */
|
||||
/*#define NVGPU_DEBUG*/
|
||||
#define GK20A_DEFAULT_DBG_MASK (dbg_info)
|
||||
#endif
|
||||
|
||||
@@ -1141,8 +1139,8 @@ enum gk20a_dbg_categories {
|
||||
gpu_dbg_mem = BIT(31), /* memory accesses, very verbose */
|
||||
};
|
||||
|
||||
#if defined(GK20A_DEBUG)
|
||||
extern u32 gk20a_dbg_mask;
|
||||
#ifdef CONFIG_GK20A_TRACE_PRINTK
|
||||
extern u32 gk20a_dbg_ftrace;
|
||||
#define gk20a_dbg(dbg_mask, format, arg...) \
|
||||
do { \
|
||||
@@ -1154,14 +1152,14 @@ do { \
|
||||
__func__, ##arg); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#else /* GK20A_DEBUG */
|
||||
#else
|
||||
#define gk20a_dbg(dbg_mask, format, arg...) \
|
||||
do { \
|
||||
if (0) \
|
||||
pr_info("gk20a %s: " format "\n", __func__, ##arg);\
|
||||
if (unlikely((dbg_mask) & gk20a_dbg_mask)) { \
|
||||
pr_info("gk20a %s: " format "\n", \
|
||||
__func__, ##arg); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#define gk20a_err(d, fmt, arg...) \
|
||||
|
||||
@@ -129,14 +129,13 @@ static int gp10b_populate_scatter_buffer(struct gk20a *g,
|
||||
if ((page & 7) != 0)
|
||||
scatter_buffer[page >> 3] = d;
|
||||
|
||||
#if defined(GK20A_DEBUG)
|
||||
if (unlikely(gpu_dbg_cde & gk20a_dbg_mask)) {
|
||||
gk20a_dbg(gpu_dbg_cde, "scatterBuffer content:");
|
||||
for (i=0; i < page>>3; i++) {
|
||||
gk20a_dbg(gpu_dbg_cde, " %x", scatter_buffer[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user