diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/pmu/pmu_debug.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/pmu/pmu_debug.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_debug.c b/drivers/gpu/nvgpu/common/pmu/pmu_debug.c new file mode 100644 index 00000000..744a618d --- /dev/null +++ b/drivers/gpu/nvgpu/common/pmu/pmu_debug.c | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | */ | ||
13 | |||
14 | #include <nvgpu/pmu.h> | ||
15 | #include <nvgpu/log.h> | ||
16 | #include <nvgpu/timers.h> | ||
17 | #include <nvgpu/kmem.h> | ||
18 | #include <nvgpu/dma.h> | ||
19 | #include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h> | ||
20 | |||
21 | #include "gk20a/gk20a.h" | ||
22 | |||
23 | void nvgpu_pmu_dump_elpg_stats(struct nvgpu_pmu *pmu) | ||
24 | { | ||
25 | struct gk20a *g = pmu->g; | ||
26 | |||
27 | /* Print PG stats */ | ||
28 | nvgpu_err(g, "Print PG stats"); | ||
29 | nvgpu_flcn_print_dmem(pmu->flcn, | ||
30 | pmu->stat_dmem_offset[PMU_PG_ELPG_ENGINE_ID_GRAPHICS], | ||
31 | sizeof(struct pmu_pg_stats_v2)); | ||
32 | |||
33 | gk20a_pmu_dump_elpg_stats(pmu); | ||
34 | } | ||
35 | |||
36 | void nvgpu_pmu_dump_falcon_stats(struct nvgpu_pmu *pmu) | ||
37 | { | ||
38 | struct gk20a *g = pmu->g; | ||
39 | |||
40 | nvgpu_flcn_dump_stats(pmu->flcn); | ||
41 | gk20a_pmu_dump_falcon_stats(pmu); | ||
42 | |||
43 | nvgpu_err(g, "pmu state: %d", pmu->pmu_state); | ||
44 | nvgpu_err(g, "elpg state: %d", pmu->elpg_stat); | ||
45 | |||
46 | /* PMU may crash due to FECS crash. Dump FECS status */ | ||
47 | gk20a_fecs_dump_falcon_stats(g); | ||
48 | } | ||