From patchwork Thu Dec 26 14:06:37 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: 11310573 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 5FC5B15AB for ; Thu, 26 Dec 2019 14:06:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3EA5921569 for ; Thu, 26 Dec 2019 14:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577369209; bh=I2R6Bu5kJD8KuY9dO7xtxRTVrMgrq8fYGn/rBwvgZrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xIeRumZ0lKmBci2Y0lZVDXpArvgRx1Y2jmEHJmIF9kVl/H0jAkHUStgKJ/lAMP4YR L77+tTrbTogkjfeSl4KBxggm+8ws7cPcGtDKaTfomkzyrlvgr1zPcYEeNS2Rh+H1V6 P0F4+db0Ki2R59CWGCfa5OvvBGxop8ibi+PL2oOM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726855AbfLZOGp (ORCPT ); Thu, 26 Dec 2019 09:06:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:52448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726450AbfLZOGp (ORCPT ); Thu, 26 Dec 2019 09:06:45 -0500 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 A99B62075E; Thu, 26 Dec 2019 14:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577369204; bh=I2R6Bu5kJD8KuY9dO7xtxRTVrMgrq8fYGn/rBwvgZrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yMMs1S89walorLz0dFpdbLyfXdVo6CtXlr4MVEBfOZq8M1oyAOHFb4O4ewrQ5qRYA MMipMJxUXjnxh4SJZy+doK5ro1F/SoDmFTiSRZrixLVYIh4d48xzRrHYUTXNApm0q3 RegGtjxKmCUbO8xkefjb9ytaW2ZsZJ8NHKqCgagE= From: Masami Hiramatsu To: Steven Rostedt , Frank Rowand Cc: Ingo Molnar , Randy Dunlap , 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: [PATCH v5 14/22] tracing: Add NULL trace-array check in print_synth_event() Date: Thu, 26 Dec 2019 23:06:37 +0900 Message-Id: <157736919742.11126.13760002977641565928.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157736902773.11126.2531161235817081873.stgit@devnote2> References: <157736902773.11126.2531161235817081873.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 --- 0 files changed diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index dae2c25b209a..137fc50f2b35 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -833,7 +833,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);