diff --git a/arch/nvgpu-common.yaml b/arch/nvgpu-common.yaml index 5dfd9008a..d95faa346 100644 --- a/arch/nvgpu-common.yaml +++ b/arch/nvgpu-common.yaml @@ -74,7 +74,8 @@ ecc: log: safe: no owner: Vedashree V - sources: [ common/log_common.c ] + sources: [ common/log_common.c, + include/nvgpu/trace.h ] deps: # Pretty sure this can be marked as not-safe since we plan to use diff --git a/arch/nvgpu-posix.yaml b/arch/nvgpu-posix.yaml index adb1419be..49246a893 100644 --- a/arch/nvgpu-posix.yaml +++ b/arch/nvgpu-posix.yaml @@ -53,7 +53,8 @@ headers: include/nvgpu/posix/soc_fuse.h, include/nvgpu/posix/vm.h, include/nvgpu/posix/posix_vidmem.h, - include/nvgpu/posix/posix-nvhost.h ] + include/nvgpu/posix/posix-nvhost.h, + include/nvgpu/posix/trace_gk20a.h ] queue: safe: yes diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index fa89e48de..db02b060a 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -22,8 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#include - +#include #include #include #include @@ -1953,9 +1952,11 @@ struct nvgpu_channel *nvgpu_channel_get__func(struct nvgpu_channel *ch, nvgpu_spinlock_release(&ch->ref_obtain_lock); +#ifdef CONFIG_NVGPU_TRACE if (ret != NULL) { trace_nvgpu_channel_get(ch->chid, caller); } +#endif return ret; } @@ -1965,7 +1966,9 @@ void nvgpu_channel_put__func(struct nvgpu_channel *ch, const char *caller) #if GK20A_CHANNEL_REFCOUNT_TRACKING channel_save_ref_source(ch, channel_gk20a_ref_action_put); #endif +#ifdef CONFIG_NVGPU_TRACE trace_nvgpu_channel_put(ch->chid, caller); +#endif nvgpu_atomic_dec(&ch->ref_count); if (nvgpu_cond_broadcast(&ch->ref_count_dec_wq) != 0) { nvgpu_warn(ch->g, "failed to broadcast"); diff --git a/drivers/gpu/nvgpu/common/fifo/fifo.c b/drivers/gpu/nvgpu/common/fifo/fifo.c index f3dd63c5f..8f8f5a1ce 100644 --- a/drivers/gpu/nvgpu/common/fifo/fifo.c +++ b/drivers/gpu/nvgpu/common/fifo/fifo.c @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/common/fifo/submit.c b/drivers/gpu/nvgpu/common/fifo/submit.c index a4f96a842..14cfc0550 100644 --- a/drivers/gpu/nvgpu/common/fifo/submit.c +++ b/drivers/gpu/nvgpu/common/fifo/submit.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -32,10 +32,7 @@ #include #include #include - -#ifdef CONFIG_NVGPU_TRACE -#include -#endif +#include /* * Handle the submit synchronization - pre-fences and post-fences. diff --git a/drivers/gpu/nvgpu/common/fifo/userd.c b/drivers/gpu/nvgpu/common/fifo/userd.c index 60c46afeb..0cbe76f75 100644 --- a/drivers/gpu/nvgpu/common/fifo/userd.c +++ b/drivers/gpu/nvgpu/common/fifo/userd.c @@ -1,7 +1,7 @@ /* * USERD * - * Copyright (c) 2011-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index 96cd11d21..441364d63 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -36,10 +36,8 @@ #include #include #include +#include -#ifdef CONFIG_NVGPU_TRACE -#include -#endif #ifdef CONFIG_NVGPU_LS_PMU #include #endif diff --git a/drivers/gpu/nvgpu/common/mm/as.c b/drivers/gpu/nvgpu/common/mm/as.c index d45105c68..70891f9b4 100644 --- a/drivers/gpu/nvgpu/common/mm/as.c +++ b/drivers/gpu/nvgpu/common/mm/as.c @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/common/vgpu/fifo/fifo_vgpu.c b/drivers/gpu/nvgpu/common/vgpu/fifo/fifo_vgpu.c index 1c1acd2f5..1ff6af71d 100644 --- a/drivers/gpu/nvgpu/common/vgpu/fifo/fifo_vgpu.c +++ b/drivers/gpu/nvgpu/common/vgpu/fifo/fifo_vgpu.c @@ -1,7 +1,7 @@ /* * Virtualized GPU Fifo * - * Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/common/vgpu/fifo/userd_vgpu.c b/drivers/gpu/nvgpu/common/vgpu/fifo/userd_vgpu.c index 17df7554c..11847e72d 100644 --- a/drivers/gpu/nvgpu/common/vgpu/fifo/userd_vgpu.c +++ b/drivers/gpu/nvgpu/common/vgpu/fifo/userd_vgpu.c @@ -1,7 +1,7 @@ /* * Virtualized GPU USERD * - * Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include diff --git a/drivers/gpu/nvgpu/hal/cbc/cbc_gm20b.c b/drivers/gpu/nvgpu/hal/cbc/cbc_gm20b.c index 30f929388..92c9a0830 100644 --- a/drivers/gpu/nvgpu/hal/cbc/cbc_gm20b.c +++ b/drivers/gpu/nvgpu/hal/cbc/cbc_gm20b.c @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/cbc/cbc_gp10b.c b/drivers/gpu/nvgpu/hal/cbc/cbc_gp10b.c index 7e649d490..cb8a7e157 100644 --- a/drivers/gpu/nvgpu/hal/cbc/cbc_gp10b.c +++ b/drivers/gpu/nvgpu/hal/cbc/cbc_gp10b.c @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/cbc/cbc_tu104.c b/drivers/gpu/nvgpu/hal/cbc/cbc_tu104.c index b1bbe4c88..c099a8162 100644 --- a/drivers/gpu/nvgpu/hal/cbc/cbc_tu104.c +++ b/drivers/gpu/nvgpu/hal/cbc/cbc_tu104.c @@ -29,11 +29,7 @@ #include #include #include - -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include "cbc_tu104.h" diff --git a/drivers/gpu/nvgpu/hal/fb/fb_gm20b.c b/drivers/gpu/nvgpu/hal/fb/fb_gm20b.c index 34b3262c1..fb8e32940 100644 --- a/drivers/gpu/nvgpu/hal/fb/fb_gm20b.c +++ b/drivers/gpu/nvgpu/hal/fb/fb_gm20b.c @@ -1,7 +1,7 @@ /* * GM20B GPC MMU * - * Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/fb/fb_gm20b_fusa.c b/drivers/gpu/nvgpu/hal/fb/fb_gm20b_fusa.c index a4ec5d8c9..6579a461c 100644 --- a/drivers/gpu/nvgpu/hal/fb/fb_gm20b_fusa.c +++ b/drivers/gpu/nvgpu/hal/fb/fb_gm20b_fusa.c @@ -1,7 +1,7 @@ /* * GM20B GPC MMU * - * Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/fb/fb_tu104.c b/drivers/gpu/nvgpu/hal/fb/fb_tu104.c index 9bd332fb1..219fc537a 100644 --- a/drivers/gpu/nvgpu/hal/fb/fb_tu104.c +++ b/drivers/gpu/nvgpu/hal/fb/fb_tu104.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,10 +20,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/fifo/mmu_fault_gk20a.c b/drivers/gpu/nvgpu/hal/fifo/mmu_fault_gk20a.c index b9e4c24e3..1545fe1ea 100644 --- a/drivers/gpu/nvgpu/hal/fifo/mmu_fault_gk20a.c +++ b/drivers/gpu/nvgpu/hal/fifo/mmu_fault_gk20a.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,9 +20,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b.c b/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b.c index 2a0b72330..4674fd43e 100644 --- a/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b.c +++ b/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b.c @@ -1,7 +1,7 @@ /* * GM20B L2 * - * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2020 NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b_dbg.c b/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b_dbg.c index f78eb6b33..bc259ef25 100644 --- a/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b_dbg.c +++ b/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b_dbg.c @@ -1,7 +1,7 @@ /* * GM20B L2 * - * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2020 NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b_fusa.c b/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b_fusa.c index 08c147459..ad75be2d9 100644 --- a/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b_fusa.c +++ b/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b_fusa.c @@ -1,7 +1,7 @@ /* * GM20B L2 * - * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2020 NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -22,10 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/ltc/ltc_tu104.c b/drivers/gpu/nvgpu/hal/ltc/ltc_tu104.c index 0fa2ce4f3..de39f6c91 100644 --- a/drivers/gpu/nvgpu/hal/ltc/ltc_tu104.c +++ b/drivers/gpu/nvgpu/hal/ltc/ltc_tu104.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -25,11 +25,7 @@ #include #include #include - -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include "ltc_tu104.h" #include "ltc_gv11b.h" diff --git a/drivers/gpu/nvgpu/hal/mm/cache/flush_gk20a.c b/drivers/gpu/nvgpu/hal/mm/cache/flush_gk20a.c index d730d7142..84c776b77 100644 --- a/drivers/gpu/nvgpu/hal/mm/cache/flush_gk20a.c +++ b/drivers/gpu/nvgpu/hal/mm/cache/flush_gk20a.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,10 +20,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/mm/cache/flush_gk20a_fusa.c b/drivers/gpu/nvgpu/hal/mm/cache/flush_gk20a_fusa.c index a07ad1aa4..0ee94af34 100644 --- a/drivers/gpu/nvgpu/hal/mm/cache/flush_gk20a_fusa.c +++ b/drivers/gpu/nvgpu/hal/mm/cache/flush_gk20a_fusa.c @@ -20,10 +20,7 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/include/nvgpu/posix/trace_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/posix/trace_gk20a.h new file mode 100644 index 000000000..37a2fe55e --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/posix/trace_gk20a.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef NVGPU_POSIX_TRACE_GK20A_H +#define NVGPU_POSIX_TRACE_GK20A_H + +#include + +static inline void trace_gk20a_mm_fb_flush(const char *name){} + +static inline void trace_gk20a_mm_fb_flush_done(const char *name){} + +static inline void trace_gk20a_mm_l2_invalidate(const char *name){} + +static inline void trace_gk20a_mm_l2_invalidate_done(const char *name){} + +static inline void trace_gk20a_mm_l2_flush(const char *name){} + +static inline void trace_gk20a_mm_l2_flush_done(const char *name){} + +static inline void trace_nvgpu_channel_open_new(int chid){} +static inline void trace_gk20a_release_used_channel(int chid){} +static inline void trace_nvgpu_channel_get(u32 chid, const char *caller){} +static inline void trace_nvgpu_channel_put(u32 chid, const char *caller){} +static inline void trace_gk20a_free_channel(int chid){} +static inline void trace_nvgpu_channel_update(int chid){} +static inline void trace_gk20a_mmu_fault(u64 fault_addr, + u32 fault_type, + u32 access_type, + u64 inst_ptr, + u32 engine_id, + const char *client_type_desc, + const char *client_id_desc, + const char *fault_type_desc){} +#ifdef CONFIG_NVGPU_COMPRESSION +static inline void trace_gk20a_ltc_cbc_ctrl_start(const char *name, + u32 cbc_ctrl, u32 min_value, u32 max_value) {} +static inline void trace_gk20a_ltc_cbc_ctrl_done(const char *name) {} +#endif +static inline void trace_gk20a_mm_tlb_invalidate(const char *name) {} +static inline void trace_gk20a_mm_tlb_invalidate_done(const char *name) {} +static inline void trace_gk20a_channel_reset(u32 chid, u32 tsgid) {} + +static inline void trace_gk20a_channel_submit_gpfifo(const char *name, + u32 chid, + u32 num_entries, + u32 flags, + u32 wait_id, + u32 wait_value) {} +static inline void trace_gk20a_channel_submitted_gpfifo(const char *name, + u32 chid, + u32 num_entries, + u32 flags, + u32 incr_id, + u32 incr_value) {} +static inline void trace_gk20a_push_cmdbuf(const char *name, + u32 mem_id, + u32 words, + u32 offset, + void *cmdbuf) {} +#endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/trace.h b/drivers/gpu/nvgpu/include/nvgpu/trace.h new file mode 100644 index 000000000..a17476918 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/trace.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef NVGPU_TRACE_H +#define NVGPU_TRACE_H + +#ifdef CONFIG_NVGPU_TRACE +#ifdef __KERNEL__ +#include +#else +#include +#endif +#endif + +#endif /* NVGPU_TRACE_H */ diff --git a/drivers/gpu/nvgpu/os/linux/cde.c b/drivers/gpu/nvgpu/os/linux/cde.c index 00ea111f6..171881cbc 100644 --- a/drivers/gpu/nvgpu/os/linux/cde.c +++ b/drivers/gpu/nvgpu/os/linux/cde.c @@ -20,11 +20,7 @@ #include #include #include - -#ifdef CONFIG_NVGPU_TRACE -#include -#endif - +#include #include #include #include diff --git a/drivers/gpu/nvgpu/os/linux/fecs_trace_linux.c b/drivers/gpu/nvgpu/os/linux/fecs_trace_linux.c index 1a53890bf..58628f004 100644 --- a/drivers/gpu/nvgpu/os/linux/fecs_trace_linux.c +++ b/drivers/gpu/nvgpu/os/linux/fecs_trace_linux.c @@ -18,9 +18,7 @@ #include #include #include -#ifdef CONFIG_NVGPU_TRACE -#include -#endif +#include #include #include #include diff --git a/drivers/gpu/nvgpu/os/linux/intr.c b/drivers/gpu/nvgpu/os/linux/intr.c index 976d41e8e..825a09f75 100644 --- a/drivers/gpu/nvgpu/os/linux/intr.c +++ b/drivers/gpu/nvgpu/os/linux/intr.c @@ -11,9 +11,7 @@ * more details. */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif +#include #include #include diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_as.c b/drivers/gpu/nvgpu/os/linux/ioctl_as.c index 15a683aa9..6526d4175 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_as.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_as.c @@ -1,7 +1,7 @@ /* * GK20A Address Spaces * - * Copyright (c) 2011-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2020, 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, @@ -16,10 +16,7 @@ #include #include #include - -#ifdef CONFIG_NVGPU_TRACE -#include -#endif +#include #include diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_channel.c b/drivers/gpu/nvgpu/os/linux/ioctl_channel.c index d5774669a..83569cb70 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_channel.c @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifdef CONFIG_NVGPU_TRACE -#include -#endif +#include #include #include #include diff --git a/drivers/gpu/nvgpu/os/linux/linux-channel.c b/drivers/gpu/nvgpu/os/linux/linux-channel.c index e80c002be..63f651344 100644 --- a/drivers/gpu/nvgpu/os/linux/linux-channel.c +++ b/drivers/gpu/nvgpu/os/linux/linux-channel.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2017-2020, 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, @@ -38,9 +38,7 @@ #include #include -#ifdef CONFIG_NVGPU_TRACE -#include -#endif +#include #include #include "sync_sema_android.h" diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index fe56fcd08..f52976493 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -91,9 +91,7 @@ #define GK20A_WAIT_FOR_IDLE_MS 2000 #define CREATE_TRACE_POINTS -#ifdef CONFIG_NVGPU_TRACE -#include -#endif +#include static int nvgpu_wait_for_idle(struct gk20a *g) { diff --git a/include/trace/events/gk20a.h b/include/trace/events/gk20a.h index ca2c950cb..c52f05382 100644 --- a/include/trace/events/gk20a.h +++ b/include/trace/events/gk20a.h @@ -1,7 +1,7 @@ /* * gk20a event logging to ftrace. * - * Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2020, 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, @@ -18,8 +18,8 @@ #undef TRACE_SYSTEM #define TRACE_SYSTEM gk20a -#if !defined(_TRACE_GK20A_H) || defined(TRACE_HEADER_MULTI_READ) -#define _TRACE_GK20A_H +#if !defined(__NVGPU_TRACE_GK20A_H__) || defined(TRACE_HEADER_MULTI_READ) +#define __NVGPU_TRACE_GK20A_H__ #include #include @@ -625,30 +625,4 @@ DEFINE_EVENT(gk20a_cde, gk20a_cde_finished_ctx_cb, /* This part must be outside protection */ #include -#else /* Not __KERNEL__ */ - -#define trace_gk20a_mmu_fault(arg...) ((void)(NULL)) -#define trace_gk20a_release_used_channel(arg...) ((void)(NULL)) -#define trace_gk20a_free_channel(arg...) ((void)(NULL)) -#define trace_nvgpu_channel_get(arg...) ((void)(NULL)) -#define trace_nvgpu_channel_put(arg...) ((void)(NULL)) -#define trace_nvgpu_channel_open_new(arg...) ((void)(NULL)) -#define trace_nvgpu_channel_update(arg...) ((void)(NULL)) -#define trace_gk20a_channel_reset(arg...) ((void)(NULL)) - -#define trace_gk20a_mm_fb_flush(arg...) ((void)(NULL)) -#define trace_gk20a_mm_fb_flush_done(arg...) ((void)(NULL)) -#define trace_gk20a_mm_l2_invalidate(arg...) ((void)(NULL)) -#define trace_gk20a_mm_l2_invalidate_done(arg...) ((void)(NULL)) -#define trace_gk20a_mm_l2_flush(arg...) ((void)(NULL)) -#define trace_gk20a_mm_l2_flush_done(arg...) ((void)(NULL)) -#define trace_gk20a_mm_tlb_invalidate(arg...) ((void)(NULL)) -#define trace_gk20a_mm_tlb_invalidate_done(arg...) ((void)(NULL)) -#define trace_gk20a_ltc_cbc_ctrl_start(arg...) ((void)(NULL)) -#define trace_gk20a_ltc_cbc_ctrl_done(arg...) ((void)(NULL)) - -#define trace_gk20a_channel_submit_gpfifo(arg...) ((void)(NULL)) -#define trace_gk20a_channel_submitted_gpfifo(arg...) ((void)(NULL)) -#define trace_gk20a_push_cmdbuf(arg...) ((void)(NULL)) - #endif