Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp988458imm; Fri, 13 Jul 2018 09:32:38 -0700 (PDT) X-Received: by 2002:a62:8d7:: with SMTP id 84-v6mr7839591pfi.172.1531499318580; Fri, 13 Jul 2018 09:28:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe2Gu+HjPK1ffTbmRz4NjVX2Iilm7C3l4+3YEZT0yOckwHyb+gbV8soKlSNPBKgh1oMUnhb X-Received: by 2002:a62:8d7:: with SMTP id 84-v6mr7839527pfi.172.1531499317890; Fri, 13 Jul 2018 09:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531499317; cv=none; d=google.com; s=arc-20160816; b=EeVhYBhQTBv0fCRxIkoRGGE6d0ion4MNu9dqllF+1bG1fbabNqJ91sBw8Zpk/6qTa7 MBgjksg6ZETy2qW+gWSXrLH05ad4T2yUkm0+82ES+2EIPVARpXnQZZGLvm11WBT6xLod +vzm/UHfirglti4AfPt+ucfrPHVtDopbr9WI23LGrl3rYHqZonRfJrwuXd6Q1las9Nbw RPPb13/iZDvqH9drnj7uDmV50Q7AX2A3gWhKAsh4gMoSqZxJTEVVJa18Fbrn1gbG95Qe 7AuVwVAZsJHl6oVQ0reXqdjL/dRsl9VBgbg1SsKMRgsy5otPc8N79t/gw6hG77vdeKiV p2sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=s5Jmv+bkYSdR8tybSDVUzh85IpJrWbtmIrH7Qa8j4nI=; b=x3vveAsjGk/biiIwO6QwvFd40gQrxyFsRSHosK2Ook34N/ejRyui7v3OJ1uLE3+F7S U0XE3qTpekbQwIKop7CvMoK/oTuUAKrUfYpgFtAPhaZR36cBWJlRWJOMn3Ye9pr+ffDF w6QB9qhtjhGAycyGJVw09JT3ymJmlq3tNIBa/Nb56HJlDCgYSCZPugNAzsDP8zjJVJCy C9wrPbjUYUD2po58Q5ICF5+j85mCkzZItSnBe0ZY9U/7hOuk2arcN8Mxp7TIeW2N5Fn9 RKNz5vcbEFYd1yp9BZi7TTei5/unwFczEex/qLR+E+oDS8xyhN2gt9V9sixYrp+mpdOZ nykQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EnStcpHK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v65-v6si25335207pfb.324.2018.07.13.09.28.22; Fri, 13 Jul 2018 09:28:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EnStcpHK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387773AbeGMQnD (ORCPT + 99 others); Fri, 13 Jul 2018 12:43:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:46770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729788AbeGMQnC (ORCPT ); Fri, 13 Jul 2018 12:43:02 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 95F1220850; Fri, 13 Jul 2018 16:27:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531499261; bh=qn9ll6DAnyTNh6KgOctvtHxHYhFUy6UwYasfVP8wxFo=; h=From:To:Cc:Subject:Date:From; b=EnStcpHKxJzP/rln7c00vbhxyCcqM8JX+PfVbEL8udQeKbMKLEos7jpIK3iLRkuDL LYI3P/Lc0Fb8pPNJUDgaz+nhjjyebg1Yfm5atOiBiXzgH/ryl1g6j07zkfj/Jpb1YB fYq5am9/+rxqoiXcvx8AnozxnexQByAsG0MSzvdE= From: Masami Hiramatsu To: Steven Rostedt Cc: Ingo Molnar , Shuah Khan , Masami Hiramatsu , Tom Zanussi , Hiraku Toyooka , linux-kernel@vger.kernel.org Subject: [PATCH 0/3] tracing: Fix bugs on snapshot feature Date: Sat, 14 Jul 2018 01:27:17 +0900 Message-Id: <153149923649.11274.14970833360963898112.stgit@devbox> X-Mailer: git-send-email 2.13.6 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Here is 2 bugfixes and 1 testcase related to ftrace snapshot feature. The 1st one is a double free bug and happens very rare. It happened on my pc when I was cleaning up ftracetest (but not reproducible). Anyway, it was easy to find the root cause because I had a backtrace. The 2nd one is an odd behavior of snapshotting. Since it is easy to reproduce, I made a kselftest testcase for this bug too. Thank you, --- Masami Hiramatsu (3): [BUGFIX] tracing: Fix double free of event_trigger_data [BUGFIX] ring_buffer: tracing: Inherit the tracing setting to next ring buffer selftests/ftrace: Add snapshot and tracing_on test case include/linux/ring_buffer.h | 1 + kernel/trace/ring_buffer.c | 12 +++++++++ kernel/trace/trace.c | 11 ++++++++ kernel/trace/trace.h | 2 + kernel/trace/trace_events_trigger.c | 10 ++++--- .../selftests/ftrace/test.d/00basic/snapshot.tc | 28 ++++++++++++++++++++ 6 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 tools/testing/selftests/ftrace/test.d/00basic/snapshot.tc -- Masami Hiramatsu (Linaro)