mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: pmu: check before initializing perfmon
We should check if perfmon is enabled before sending perfmon init command. This is needed for debug purposes. Change-Id: Ia95a590a76074c469b5d87a5820cd5b2e50d13be Signed-off-by: Deepak Goyal <dgoyal@nvidia.com> Reviewed-on: https://git-master/r/1510036 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
4166fc2f87
commit
75d7d6826d
@@ -12,6 +12,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <nvgpu/enabled.h>
|
||||
#include "debug_pmu.h"
|
||||
#include "gk20a/platform_gk20a.h"
|
||||
|
||||
@@ -348,10 +349,12 @@ static ssize_t perfmon_events_enable_write(struct file *file,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (val && !g->pmu.perfmon_sampling_enabled) {
|
||||
if (val && !g->pmu.perfmon_sampling_enabled &&
|
||||
nvgpu_is_enabled(g, NVGPU_PMU_PERFMON)) {
|
||||
g->pmu.perfmon_sampling_enabled = true;
|
||||
nvgpu_pmu_perfmon_start_sampling(&(g->pmu));
|
||||
} else if (!val && g->pmu.perfmon_sampling_enabled) {
|
||||
} else if (!val && g->pmu.perfmon_sampling_enabled &&
|
||||
nvgpu_is_enabled(g, NVGPU_PMU_PERFMON)) {
|
||||
g->pmu.perfmon_sampling_enabled = false;
|
||||
nvgpu_pmu_perfmon_stop_sampling(&(g->pmu));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user