Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751769AbdHANCO (ORCPT ); Tue, 1 Aug 2017 09:02:14 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:37997 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751008AbdHANCN (ORCPT ); Tue, 1 Aug 2017 09:02:13 -0400 MIME-Version: 1.0 In-Reply-To: <20170724162410.5932cb28@vmware.local.home> References: <1500880866-1177-1-git-send-email-chuhu@redhat.com> <20170724162410.5932cb28@vmware.local.home> From: Chunyu Hu Date: Tue, 1 Aug 2017 21:02:12 +0800 Message-ID: Subject: Re: [PATCH] tracing: Fix trace_pipe_raw read panic To: Steven Rostedt Cc: Chunyu Hu , Ingo Molnar , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1220 Lines: 33 A gentle ping. Any comment on this? Maybe have better solution for this? On 25 July 2017 at 04:24, Steven Rostedt wrote: > > Hi Chunyu, > > Thanks for the patch. I'm currently traveling, and will have little > time to test it. Hopefully I can get to it sometime this week. > > -- Steve > > > On Mon, 24 Jul 2017 15:21:06 +0800 > Chunyu Hu wrote: > >> per_cpu trace directories and files are created for all possible cpus, >> but only the cpus which have ever been on-lined have their own per cpu >> ring buffer (allocated by cpuhp threads). While trace_buffers_open, the >> open handler for trace file 'trace_pipe_raw' is always trying to access >> field of ring_buffer_per_cpu, and would panic with the NULL pointer. >> >> Align the behavior of trace_pipe_raw with trace_pipe, that returns -NODEV >> when openning it if that cpu does not have trace ring buffer. >> >> Reproduce: >> cat /sys/kernel/debug/tracing/per_cpu/cpu31/trace_pipe_raw >> (cpu31 is never on-lined, this is a 16 cores x86_64 box) >> >> Tested with: >> 1) boot with maxcpus=14, read trace_pipe_raw of cpu15. >> Got -NODEV. >> 2) oneline cpu15, read trace_pipe_raw of cpu15. >> Get the raw trace data.