Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3327842imu; Sun, 11 Nov 2018 12:28:19 -0800 (PST) X-Google-Smtp-Source: AJdET5cRHRpxmWtdMH5wJMltGlCVLyc7vHx6NiTGm424pFr4dANDTCN5XqOupZ/ZiIo7lebeP0yu X-Received: by 2002:a63:2744:: with SMTP id n65mr14916999pgn.65.1541968099062; Sun, 11 Nov 2018 12:28:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968099; cv=none; d=google.com; s=arc-20160816; b=M3ZaM/bHGK/LE6EsW4ZDidziwbrMdxe5bxG7Oj9eoFBfaFd/4wJRkwOwG2T1tr7NC3 mY2TZFKuU/T87Vr23A8+1h/rXeqVLpcVu8kW4wJqCOKoYK2ZMRDJQyLT25/30+Ih5Cao 5TldDQ9HzfdI8fexZTec4eKSdpDRczjHFHVGFjx+wztcY+NCgn5DyGrN5WKmuHmNxXR9 CPz6yindhyEo9BkyDYDiDUtuB69zx+Vse5sfxehcWf80rZz0yxl9MHk8KJUOBepwb5+N YKt4xThZxX1/cxX06SXZP7czpbj33Ldww0C7ezlG5EK6uWcqqIM3rzaQJy/2VPUBZs3O KGsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=JL3Ehn62knVupbOrdK8J8Vcy1seR1oaR4hL34zcC8Bc=; b=nLxEPD8wBzZ0t5yLAq0krTQBwQ94yrsdolFUi9b2GwmndJ6oW9HcVNjqbxkN2f6kDn LfJ4DdzMuIf5rPtT/mBO9f/ZzbKL27CZ+sG0GOt9YnERWZ9e2KUgDbsqWdC0sjWSJloT 3FIG22hwYxM9d5atlkTWmnR5rWEelxgJiXlpQ6bcCwZo9HGKwv1Ve4GT4WhI0OUgdpCV Q6JHDz5Zko5mXhQBS0eEGWpdRrCOZDm5wuZrWcBYjP0huUsOA/SZJx+kKoKWLXFxIM6j y6BH0JjZUYwfKH2cB3ei7dBQxnCVJSUISMEy25KPMoM/uARcG5erEgzMzfuU4CbFfiZX TybQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l137-v6si18623628pfd.260.2018.11.11.12.28.03; Sun, 11 Nov 2018 12:28:19 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730630AbeKLFs0 (ORCPT + 99 others); Mon, 12 Nov 2018 00:48:26 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50740 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730392AbeKLFsZ (ORCPT ); Mon, 12 Nov 2018 00:48:25 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsi-0000oJ-DG; Sun, 11 Nov 2018 19:58:52 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsa-0001r8-34; Sun, 11 Nov 2018 19:58:44 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Peter Oberparleiter" , "Andrey Ryabinin" , "Yuan Pengfei" , "Lorenzo Stoakes" , "Linus Torvalds" , "Arnd Bergmann" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 336/366] gcov: add support for GCC 5.1 In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Lorenzo Stoakes commit 3e44c471a2dab210f7e9b1e5f7d4d54d52df59eb upstream. Fix kernel gcov support for GCC 5.1. Similar to commit a992bf836f9 ("gcov: add support for GCC 4.9"), this patch takes into account the existence of a new gcov counter (see gcc's gcc/gcov-counter.def.) Firstly, it increments GCOV_COUNTERS (to 10), which makes the data structure struct gcov_info compatible with GCC 5.1. Secondly, a corresponding counter function __gcov_merge_icall_topn (Top N value tracking for indirect calls) is included in base.c with the other gcov counters unused for kernel profiling. Signed-off-by: Lorenzo Stoakes Cc: Andrey Ryabinin Cc: Yuan Pengfei Tested-by: Peter Oberparleiter Reviewed-by: Peter Oberparleiter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Cc: Arnd Bergmann Signed-off-by: Ben Hutchings --- kernel/gcov/base.c | 6 ++++++ kernel/gcov/gcc_4_7.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) --- a/kernel/gcov/base.c +++ b/kernel/gcov/base.c @@ -91,6 +91,12 @@ void __gcov_merge_time_profile(gcov_type } EXPORT_SYMBOL(__gcov_merge_time_profile); +void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} +EXPORT_SYMBOL(__gcov_merge_icall_topn); + /** * gcov_enable_events - enable event reporting through gcov_event() * --- a/kernel/gcov/gcc_4_7.c +++ b/kernel/gcov/gcc_4_7.c @@ -18,7 +18,9 @@ #include #include "gcov.h" -#if __GNUC__ == 4 && __GNUC_MINOR__ >= 9 +#if __GNUC__ == 5 && __GNUC_MINOR__ >= 1 +#define GCOV_COUNTERS 10 +#elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 #define GCOV_COUNTERS 9 #else #define GCOV_COUNTERS 8