Skip to content

Commit

Permalink
hwtracing: hisi_ptt: Don't try to attach a task
Browse files Browse the repository at this point in the history
PTT is an uncore PMU and shouldn't be attached to any task. Block
the usage in pmu::event_init().

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20231010084731.30450-5-yangyicong@huawei.com
  • Loading branch information
Yicong Yang authored and Suzuki K Poulose committed Nov 13, 2023
1 parent e0dd27a commit aff787f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/hwtracing/ptt/hisi_ptt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,9 @@ static int hisi_ptt_pmu_event_init(struct perf_event *event)
return -EOPNOTSUPP;
}

if (event->attach_state & PERF_ATTACH_TASK)
return -EOPNOTSUPP;

if (event->attr.type != hisi_ptt->hisi_ptt_pmu.type)
return -ENOENT;

Expand Down

0 comments on commit aff787f

Please sign in to comment.