u32 prev_pid = perf_sample__intval(sample, "prev_pid"),
next_pid = perf_sample__intval(sample, "next_pid");
+ if (this_cpu < 0 || this_cpu >= MAX_CPUS) {
+ pr_warning("Out-of-bound sample CPU %d. Skipping sample\n", this_cpu);
+ return 0;
+ }
+
if (sched->curr_pid[this_cpu] != (u32)-1) {
/*
* Are we trying to switch away a PID that is
{
struct perf_sched *sched = container_of(tool, struct perf_sched, tool);
+ if (sample->cpu >= MAX_CPUS) {
+ pr_warning("Out-of-bound sample CPU %u. Skipping sample\n", sample->cpu);
+ return 0;
+ }
+
if (sched->tp_handler->runtime_event)
return sched->tp_handler->runtime_event(sched, sample, machine);
int rc = 0;
const char state = perf_sample__taskstate(sample, "prev_state");
+ if (sample->cpu >= MAX_CPUS) {
+ pr_warning("Out-of-bound sample CPU %d. Skipping sample\n", sample->cpu);
+ return 0;
+ }
+
addr_location__init(&al);
if (machine__resolve(machine, &al, sample) < 0) {
pr_err("problem processing %d event. skipping it\n",