From patchwork Mon Aug 26 03:17:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 11113897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F7C21398 for ; Mon, 26 Aug 2019 03:17:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D4402173E for ; Mon, 26 Aug 2019 03:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566789467; bh=1MgpH1r23u2tqpsRDhiOww76XSTOfo2+LJaAlGqRg44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZnGPkl1iP5OlhlwkxuYLS8bKA2sEEvTLk2vBEsupw6UbNba8fk0YzSM8uTvNp9UvH pXmpQgJp1Xj1Dt9dFLMyrriNmKnDmwGwF4LdqKqQWGnrReJeSCnHSta9s5sA414So5 gkk7+d6NbzdUXus55ICrJ0IToNOHv3xYrzVkrbA0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729557AbfHZDRo (ORCPT ); Sun, 25 Aug 2019 23:17:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:36574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729292AbfHZDRn (ORCPT ); Sun, 25 Aug 2019 23:17:43 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D19562168B; Mon, 26 Aug 2019 03:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566789462; bh=1MgpH1r23u2tqpsRDhiOww76XSTOfo2+LJaAlGqRg44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zaXDSbi+ox96xhO+enb6+FyW0JgXbUv/q9TK5OX23mUY4QpkElBk/cXC27VH7vYVf RzJL/bmO8P70DmL5emCXieC+1JmaG7s/2SrvORkwT5FrYa8UuDIakmLHJt/oJGec45 99i9dgUyMrLHFoagWS0qJq6+rMHbyrDJOCwK0cdk= From: Masami Hiramatsu To: Steven Rostedt , Frank Rowand Cc: Ingo Molnar , Namhyung Kim , Tim Bird , Jiri Olsa , Arnaldo Carvalho de Melo , Tom Zanussi , Rob Herring , Andrew Morton , Thomas Gleixner , Greg Kroah-Hartman , Alexey Dobriyan , Jonathan Corbet , Linus Torvalds , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v3 10/19] tracing: Add NULL trace-array check in print_synth_event() Date: Mon, 26 Aug 2019 12:17:36 +0900 Message-Id: <156678945659.21459.15789978012125587066.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <156678933823.21459.4100380582025186209.stgit@devnote2> References: <156678933823.21459.4100380582025186209.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Add NULL trace-array check in print_synth_event(), because if we enable tp_printk option, iter->tr can be NULL. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_events_hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index a7f447195143..db973928e580 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -822,7 +822,7 @@ static enum print_line_t print_synth_event(struct trace_iterator *iter, fmt = synth_field_fmt(se->fields[i]->type); /* parameter types */ - if (tr->trace_flags & TRACE_ITER_VERBOSE) + if (tr && tr->trace_flags & TRACE_ITER_VERBOSE) trace_seq_printf(s, "%s ", fmt); snprintf(print_fmt, sizeof(print_fmt), "%%s=%s%%s", fmt);