Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4658899yba; Wed, 17 Apr 2019 16:41:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIUuhiMPbUkhavXukKMzdab2FvcaXHSkI9FHjSg3QSu+WZkUqZmQjDaAIDQJWHucKflzG2 X-Received: by 2002:a65:66c6:: with SMTP id c6mr1746437pgw.383.1555544507629; Wed, 17 Apr 2019 16:41:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555544507; cv=none; d=google.com; s=arc-20160816; b=aQ0HrmXEOCKDBfaRf3KSKFNkYGO1Zb7YC+zzCISHROomkCer1O8OkmlTuJpRizJaN0 xo7AuY6p4mw29StuyJnl3c5mNh07QPg40aSb+U/8BuZ3uSlkYeEpmrb98z2ikzKaruWu jW5w2ZH8jR1rZTtv6zuzuvCnTk3Q7j/+2wipLGUnqRUL83lMzrdMpQT5sm4htO5TDTAE 5ckiYDoNrs4TjjNtUo0F8d5ak9gVhwGjLs8IiOm9ueNl+9nOpwA39ZhjnbtszzvP7qE8 kx1xd0bL6cfViMnNTdr58N/oQhUyo94L2qc/1KBhXhH3aOuMNElqsMeW9k3/hjpbndda nCqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wwZ1yeOi33pxj7r4a6TdB0llsmTaierV6kg9OztFX38=; b=UnVlSteNZNkzxvAMF7C0t10hud0nMEcVGokwLhkShfLDnA8ZMddyxLF172n9gcYhzF jqBtuSuQfIRjttPVvcTQghZyINsHkXcYhkcBzqi51PCI9MSywlygCtwW/IyhvpibxS5Y D9ClaiJym2DS+bteEfPeLcaf5G7myR5l9Nh8xrlEsBe5o6BWcIQtEt2yqUsFy4RmmqoT ExQgs8K7W2xY2AL+k4sZr7VQflTMuQJ5lXRo6V7+JZh+9nIGMIhAlakPWz/WQIkxPzRK wxc71jGvIESXthuxx4qOB6KVbMT0jo+IxH1YR+Cc4h98TjAL7bsD9FipRquWtlropgxD nSsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=P3pqAGBB; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h29si510514pfd.180.2019.04.17.16.41.32; Wed, 17 Apr 2019 16:41:47 -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=@android.com header.s=20161025 header.b=P3pqAGBB; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387506AbfDQXjO (ORCPT + 99 others); Wed, 17 Apr 2019 19:39:14 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:45989 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729079AbfDQXjN (ORCPT ); Wed, 17 Apr 2019 19:39:13 -0400 Received: by mail-ot1-f67.google.com with SMTP id e5so146681otk.12 for ; Wed, 17 Apr 2019 16:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wwZ1yeOi33pxj7r4a6TdB0llsmTaierV6kg9OztFX38=; b=P3pqAGBBE/EdbOzi5Mt7OhL/roYgUDO8ApmcfA6+vzL3W3x+qXknBqmyLnT3F2/6yT ChzziSUvQZ4R3UXxJZ1Y4jKlVNnE2ScXAJN93WPqDkjHribAl4zZ46YfvfCdw0B4yDST 9YVTQTfKgWh5mfNeQKzz8rm07Ack/DRJxEKnRXkFj/lGl+yh7EQTuGHZ0ShRMXEIjenG 1fT21yYiNC98Hc6JO6cKNtuOOA5LAxqc49XyCgZh+pQizi98U6F9KoU4r3IWZkqaq9UT 9vJV7kK2HW46Qz64d4abT9HKjqKxfX1VX7dfc8hgiuzcr99SxQiNsFBfCfHcddZD8cCV liXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wwZ1yeOi33pxj7r4a6TdB0llsmTaierV6kg9OztFX38=; b=KKy/Z4yykZXLRAtZM4bPnKVutwhPrEMUro+b2hfSAdlT4rSzszn7cqEbsT5L7i5mqz oMeLDMB0zJn97bmdpMsscs7fdcL9xclh5fKslbNaoXlyOUM/ynubgLFygfBvbsMGOxvC 8bZk4/kPVWR51MZJ1YlJSdjxQRRWVKaZByt3Z6P8U3Pk6wB2NEKIgZzsqXHXkhpkRRHX eWreWzyTlIfhU7ZsayoLHJtSSmaXUEF4P7WCYPwHzWoBNivlG4i6HRAuVs7v/NMq43Y0 TZNz/soQ5PfRtOPwDLOkPryBdm52veaS9piMQlgjg/ZISnN2j4qnWj0ke2nod5njRKPJ w/Pw== X-Gm-Message-State: APjAAAUdcUJfZk6DhQpgCnONBzZ/oL4o0SU7hUxP+Eyp/JgpLdff/q81 dTZPFZ7FnljExFHiOBAcIBSP6CZ4UGZ2Ja1OcJR5dg== X-Received: by 2002:a9d:5188:: with SMTP id y8mr1805512otg.357.1555544352635; Wed, 17 Apr 2019 16:39:12 -0700 (PDT) MIME-Version: 1.0 References: <20190417225328.208129-1-trong@android.com> <20190417162139.2ca3ba78eab414b2fa854a07@linux-foundation.org> In-Reply-To: <20190417162139.2ca3ba78eab414b2fa854a07@linux-foundation.org> From: Tri Vo Date: Wed, 17 Apr 2019 16:39:01 -0700 Message-ID: Subject: Re: [PATCH v5] gcov: Clang support To: Andrew Morton Cc: Greg Hackmann , Nick Desaulniers , LKML , Peter Oberparleiter , Trilok Soni , Prasad Sodagudi , Daniel Mentz , Petri Gynther Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 17, 2019 at 4:21 PM Andrew Morton wrote: > > On Wed, 17 Apr 2019 15:53:28 -0700 Tri Vo wrote: > > > LLVM uses profiling data that's deliberately similar to GCC, but has a very > > different way of exporting that data. LLVM calls llvm_gcov_init() once per > > module, and provides a couple of callbacks that we can use to ask for more > > data. > > > > We care about the "writeout" callback, which in turn calls back into > > compiler-rt/this module to dump all the gathered coverage data to disk: > > > > llvm_gcda_start_file() > > llvm_gcda_emit_function() > > llvm_gcda_emit_arcs() > > llvm_gcda_emit_function() > > llvm_gcda_emit_arcs() > > [... repeats for each function ...] > > llvm_gcda_summary_info() > > llvm_gcda_end_file() > > > > This design is much more stateless and unstructured than gcc's, and is > > intended to run at process exit. This forces us to keep some local state > > about which module we're dealing with at the moment. On the other hand, it > > also means we don't depend as much on how LLVM represents profiling data > > internally. > > > > See LLVM's lib/Transforms/Instrumentation/GCOVProfiling.cpp for more > > details on how this works, particularly GCOVProfiler::emitProfileArcs(), > > GCOVProfiler::insertCounterWriteout(), and GCOVProfiler::insertFlush(). > > checkpatch speaketh truth. > > Also, I'll change those Co-authored-by's to the documented Co-developed-by. > > > From: Andrew Morton > Subject: gcov-clang-support-checkpatch-fixes > > WARNING: Non-standard signature: Co-authored-by: > #31: > Co-authored-by: Nick Desaulniers > > WARNING: Non-standard signature: Co-authored-by: > #32: > Co-authored-by: Tri Vo > > WARNING: Possible unnecessary 'out of memory' message > #158: FILE: kernel/gcov/clang.c:90: > + if (!info) { > + pr_warn_ratelimited("failed to allocate gcov info\n"); > > WARNING: Possible unnecessary 'out of memory' message > #193: FILE: kernel/gcov/clang.c:125: > + if (!info) { > + pr_warn_ratelimited("failed to allocate gcov function info for %s\n", > > WARNING: line over 80 characters > #546: FILE: kernel/gcov/clang.c:478: > + pos += store_gcov_u32(buffer, pos, fi_ptr->cfg_checksum); > > total: 0 errors, 5 warnings, 663 lines checked > > NOTE: For some of the reported defects, checkpatch may be able to > mechanically convert to the typical style using --fix or --fix-inplace. > > ./patches/gcov-clang-support.patch has style problems, please review. > > NOTE: If any of the errors are false positives, please report > them to the maintainer, see CHECKPATCH in MAINTAINERS. > > Please run checkpatch prior to sending patches Thanks! I'll keep that in mind.