All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tri Vo <trong@android.com>
To: oberpar@linux.ibm.com
Cc: ghackmann@android.com, ndesaulniers@google.com,
	linux-kernel@vger.kernel.org, kernel-team@android.com,
	yamada.masahiro@socionext.com, akpm@linux-foundation.org,
	Tri Vo <trong@android.com>
Subject: [PATCH v4 0/3] gcov: add Clang support
Date: Sun, 17 Mar 2019 19:54:08 -0700	[thread overview]
Message-ID: <20190318025411.98014-1-trong@android.com> (raw)

This patch series adds Clang support for gcov.

Patch 1 refactors existing code in preparation for Clang support.
Patch 2 implements necessary LLVM runtime hooks and gcov kernel interfaces.
Patch 3 updates documentation.

Greg Hackmann (2):
  gcov: Clang: move common GCC code into gcc_base.c
  gcov: Clang support

Tri Vo (1):
  gcov: docs: add a note on GCC vs Clang differences

 Documentation/dev-tools/gcov.rst |  18 +-
 kernel/gcov/Kconfig              |   3 +-
 kernel/gcov/Makefile             |   5 +-
 kernel/gcov/base.c               |  86 +----
 kernel/gcov/clang.c              | 586 +++++++++++++++++++++++++++++++
 kernel/gcov/gcc_3_4.c            |  12 +
 kernel/gcov/gcc_4_7.c            |  12 +
 kernel/gcov/gcc_base.c           |  86 +++++
 kernel/gcov/gcov.h               |   5 +
 9 files changed, 723 insertions(+), 90 deletions(-)
 create mode 100644 kernel/gcov/clang.c
 create mode 100644 kernel/gcov/gcc_base.c

v2:
- Reorganized config dependencies, as per Masahiro.

v3:
- Squashed patches 2-4 of v2, as per Nick, Masahiro, and Peter.
Addressed comments by Peter:
- Moved __gcov_exit() to gcc_base.c
- Added missing header to gcc_base.c
- Removed unnecessary boundary checks in gcov_info_add().
- Changed counters' allocation to use vmalloc().
- Added check for failed allocation of filename.
- Changed list_for_each_entry_safe to list_for_each_entry when traversing
  without modifying.
- Updated Documentation/dev-tools/gcov.rst

v4:
Made following changes to pass kernel module test cases suggested by Peter:
- Generic code in base.c unlinks gcov_info data sets while iterating over
  the gcov_info list. Changed Clang's gcov_info_unlink() to preserve next
  and prev links of the unlinked gcov_info instance.
- Attributing a given gcov_info to a module is done differently in Clang vs
  GCC. Generic code in base.c needs to do this. So added
  gcov_info_within_module() interface to gcov.h to abstract away the
  difference.
- Clang provides checksums for each function. These checksums are used to
  determine whether the source files of the compiled kernel module have
  been modified. Changed gcov_info_is_compatible() to account for
  function-level checksums.
Addressed comments by Peter:
- Removed unnecessary #define, if-clause, empty line.
- Amended commit message to note documentation was adjusted to account for
  the removal of config symbol CONFIG_GCOV_FORMAT_AUTODETECT.

--
2.21.0.225.g810b269d1ac-goog


             reply	other threads:[~2019-03-18  2:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18  2:54 Tri Vo [this message]
2019-03-18  2:54 ` [PATCH v4 1/3] gcov: Clang: move common GCC code into gcc_base.c Tri Vo
2019-03-18  2:54 ` [PATCH v4 2/3] gcov: Clang support Tri Vo
2019-03-18  2:54 ` [PATCH v4 3/3] gcov: docs: add a note on GCC vs Clang differences Tri Vo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190318025411.98014-1-trong@android.com \
    --to=trong@android.com \
    --cc=akpm@linux-foundation.org \
    --cc=ghackmann@android.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=oberpar@linux.ibm.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.