mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-25 02:32:08 +03:00
video: tegra: host: nvdla: avoid trace_printk use
1. introduce TEGRA_NVDLA_TRACE_PRINTK Kconfig flag and set to 'n'
by default
2. control trace_printk using the flag
3. prevents allocation of extra kernel memory with trace_printk
presence
Bug 200350221
Change-Id: Iaa644f196fcc9a44f1b0744a55a0a0a1a585653d
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1672074
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
This commit is contained in:
committed by
Laxman Dewangan
parent
596b964084
commit
abd075040f
@@ -717,8 +717,10 @@ void nvdla_debug_init(struct platform_device *pdev)
|
||||
|
||||
debugfs_create_u32("debug_mask", S_IRUGO | S_IWUSR, de,
|
||||
&nvdla_dev->dbg_mask);
|
||||
#ifdef CONFIG_TEGRA_NVDLA_TRACE_PRINTK
|
||||
debugfs_create_u32("en_trace", S_IRUGO | S_IWUSR, de,
|
||||
&nvdla_dev->en_trace);
|
||||
#endif
|
||||
debugfs_create_u32("submit_mode", S_IRUGO | S_IWUSR, de,
|
||||
&nvdla_dev->submit_mode);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* NVDLA debug utils header
|
||||
*
|
||||
* Copyright (c) 2016, NVIDIA Corporation. All rights reserved.
|
||||
* Copyright (c) 2016 - 2018, NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
@@ -35,6 +35,7 @@ enum nvdla_dbg_categories {
|
||||
debug_perf = BIT(5), /* for tracking perf impact */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_TEGRA_NVDLA_TRACE_PRINTK
|
||||
#define nvdla_dbg(check_mask, pdev, format, arg...) \
|
||||
do { \
|
||||
struct nvhost_device_data *pdata = platform_get_drvdata(pdev); \
|
||||
@@ -51,6 +52,19 @@ do { \
|
||||
__func__, ##arg); \
|
||||
} \
|
||||
} while (0)
|
||||
#else /* CONFIG_TEGRA_NVDLA_TRACE_PRINTK */
|
||||
#define nvdla_dbg(check_mask, pdev, format, arg...) \
|
||||
do { \
|
||||
struct nvhost_device_data *pdata = platform_get_drvdata(pdev); \
|
||||
struct nvdla_device *nvdla_dev = (struct nvdla_device *) \
|
||||
pdata->private_data; \
|
||||
if (unlikely((check_mask) & nvdla_dev->dbg_mask)) { \
|
||||
pr_info("%s:%s: " format "\n", \
|
||||
dev_name(&pdev->dev), \
|
||||
__func__, ##arg); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#define nvdla_dbg_err(pdev, fmt, arg...) \
|
||||
nvdla_dbg(debug_err, pdev, fmt, ##arg)
|
||||
|
||||
Reference in New Issue
Block a user