<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/kernel/gcov/gcc_4_7.c, branch rust-6.14</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://git.kobert.dev/pm24.git/atom?h=rust-6.14</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom?h=rust-6.14'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2024-06-15T17:43:06Z</updated>
<entry>
<title>gcov: add support for GCC 14</title>
<updated>2024-06-15T17:43:06Z</updated>
<author>
<name>Peter Oberparleiter</name>
<email>oberpar@linux.ibm.com</email>
</author>
<published>2024-06-10T09:27:43Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=c1558bc57b8e5b4da5d821537cd30e2e660861d8'/>
<id>urn:sha1:c1558bc57b8e5b4da5d821537cd30e2e660861d8</id>
<content type='text'>
Using gcov on kernels compiled with GCC 14 results in truncated 16-byte
long .gcda files with no usable data.  To fix this, update GCOV_COUNTERS
to match the value defined by GCC 14.

Tested with GCC versions 14.1.0 and 13.2.0.

Link: https://lkml.kernel.org/r/20240610092743.1609845-1-oberpar@linux.ibm.com
Signed-off-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Reported-by: Allison Henderson &lt;allison.henderson@oracle.com&gt;
Reported-by: Chuck Lever III &lt;chuck.lever@oracle.com&gt;
Tested-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>gcov: add support for checksum field</title>
<updated>2022-12-21T22:31:52Z</updated>
<author>
<name>Rickard x Andersson</name>
<email>rickaran@axis.com</email>
</author>
<published>2022-12-20T10:23:18Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=e96b95c2b7a63a454b6498e2df67aac14d046d13'/>
<id>urn:sha1:e96b95c2b7a63a454b6498e2df67aac14d046d13</id>
<content type='text'>
In GCC version 12.1 a checksum field was added.

This patch fixes a kernel crash occurring during boot when using
gcov-kernel with GCC version 12.2.  The crash occurred on a system running
on i.MX6SX.

Link: https://lkml.kernel.org/r/20221220102318.3418501-1-rickaran@axis.com
Fixes: 977ef30a7d88 ("gcov: support GCC 12.1 and newer compilers")
Signed-off-by: Rickard x Andersson &lt;rickaran@axis.com&gt;
Reviewed-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Tested-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Reviewed-by: Martin Liska &lt;mliska@suse.cz&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>gcov: support GCC 12.1 and newer compilers</title>
<updated>2022-10-21T04:27:22Z</updated>
<author>
<name>Martin Liska</name>
<email>mliska@suse.cz</email>
</author>
<published>2022-10-13T07:40:59Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=977ef30a7d888eeb52fb6908f99080f33e5309a8'/>
<id>urn:sha1:977ef30a7d888eeb52fb6908f99080f33e5309a8</id>
<content type='text'>
Starting with GCC 12.1, the created .gcda format can't be read by gcov
tool.  There are 2 significant changes to the .gcda file format that
need to be supported:

a) [gcov: Use system IO buffering]
   (23eb66d1d46a34cb28c4acbdf8a1deb80a7c5a05) changed that all sizes in
   the format are in bytes and not in words (4B)

b) [gcov: make profile merging smarter]
   (72e0c742bd01f8e7e6dcca64042b9ad7e75979de) add a new checksum to the
   file header.

Tested with GCC 7.5, 10.4, 12.2 and the current master.

Link: https://lkml.kernel.org/r/624bda92-f307-30e9-9aaa-8cc678b2dfb2@suse.cz
Signed-off-by: Martin Liska &lt;mliska@suse.cz&gt;
Tested-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Reviewed-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>gcov: use kvmalloc()</title>
<updated>2021-05-07T07:26:32Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2021-05-07T01:04:51Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=1391efa952e8b22088f8626fc63ade26767b92d6'/>
<id>urn:sha1:1391efa952e8b22088f8626fc63ade26767b92d6</id>
<content type='text'>
Using vmalloc() in gcov is really quite wasteful, many of the objects
allocated are really small (e.g.  I've seen 24 bytes.) Use kvmalloc() to
automatically pick the better of kmalloc() or vmalloc() depending on the
size.

[johannes.berg@intel.com: fix clang-11+ build]
  Link: https://lkml.kernel.org/r/20210412214210.6e1ecca9cdc5.I24459763acf0591d5e6b31c7e3a59890d802f79c@changeid

Link: https://lkml.kernel.org/r/20210315235453.799e7a9d627d.I741d0db096c6f312910f7f1bcdfde0fda20801a4@changeid
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Reviewed-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Tested-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Cc: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>gcov: combine common code</title>
<updated>2021-05-07T07:26:32Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2021-05-07T01:04:45Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=7a1d55b987dfcbddecdb67eecc76fe555d4348ba'/>
<id>urn:sha1:7a1d55b987dfcbddecdb67eecc76fe555d4348ba</id>
<content type='text'>
There's a lot of duplicated code between gcc and clang implementations,
move it over to fs.c to simplify the code, there's no reason to believe
that for small data like this one would not just implement the simple
convert_to_gcda() function.

Link: https://lkml.kernel.org/r/20210315235453.e3fbb86e99a0.I08a3ee6dbe47ea3e8024956083f162884a958e40@changeid
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Acked-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>gcov: fix kernel-doc markup issue</title>
<updated>2020-12-16T06:46:18Z</updated>
<author>
<name>Alex Shi</name>
<email>alex.shi@linux.alibaba.com</email>
</author>
<published>2020-12-16T04:45:40Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=26ecea089f422b6f518f2906495a2d64ca7938d7'/>
<id>urn:sha1:26ecea089f422b6f518f2906495a2d64ca7938d7</id>
<content type='text'>
Fix the following kernel-doc issue in gcov:

  kernel/gcov/gcc_4_7.c:238: warning: Function parameter or member 'dst' not described in 'gcov_info_add'
  kernel/gcov/gcc_4_7.c:238: warning: Function parameter or member 'src' not described in 'gcov_info_add'
  kernel/gcov/gcc_4_7.c:238: warning: Excess function parameter 'dest' description in 'gcov_info_add'
  kernel/gcov/gcc_4_7.c:238: warning: Excess function parameter 'source' description in 'gcov_info_add'

Link: https://lkml.kernel.org/r/1605252352-63983-1-git-send-email-alex.shi@linux.alibaba.com
Signed-off-by: Alex Shi &lt;alex.shi@linux.alibaba.com&gt;
Acked-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>gcov: remove support for GCC &lt; 4.9</title>
<updated>2020-12-16T06:46:18Z</updated>
<author>
<name>Nick Desaulniers</name>
<email>ndesaulniers@google.com</email>
</author>
<published>2020-12-16T04:45:37Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=99b75eb7c86b05f9594e8a7826174b8bf22e82b8'/>
<id>urn:sha1:99b75eb7c86b05f9594e8a7826174b8bf22e82b8</id>
<content type='text'>
Since commit 0bddd227f3dc ("Documentation: update for gcc 4.9
requirement") the minimum supported version of GCC is gcc-4.9.  It's now
safe to remove this code.

Similar to commit 10415533a906 ("gcov: Remove old GCC 3.4 support") but
that was for GCC 4.8 and this is for GCC 4.9.

Link: https://github.com/ClangBuiltLinux/linux/issues/427
Link: https://lkml.kernel.org/r/20201111030557.2015680-1-ndesaulniers@google.com
Signed-off-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Reviewed-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>gcov: add support for GCC 10.1</title>
<updated>2020-09-11T16:33:54Z</updated>
<author>
<name>Peter Oberparleiter</name>
<email>oberpar@linux.ibm.com</email>
</author>
<published>2020-09-10T12:52:01Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=40249c6962075c040fd071339acae524f18bfac9'/>
<id>urn:sha1:40249c6962075c040fd071339acae524f18bfac9</id>
<content type='text'>
Using gcov to collect coverage data for kernels compiled with GCC 10.1
causes random malfunctions and kernel crashes.  This is the result of a
changed GCOV_COUNTERS value in GCC 10.1 that causes a mismatch between
the layout of the gcov_info structure created by GCC profiling code and
the related structure used by the kernel.

Fix this by updating the in-kernel GCOV_COUNTERS value.  Also re-enable
config GCOV_KERNEL for use with GCC 10.

Reported-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Reported-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Signed-off-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Tested-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Tested-and-Acked-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>gcov: gcc_4_7: replace zero-length array with flexible-array member</title>
<updated>2020-04-07T17:43:44Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2020-04-07T03:11:52Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=fba4168edecdd2781bcd83cb131977ec1157f87c'/>
<id>urn:sha1:fba4168edecdd2781bcd83cb131977ec1157f87c</id>
<content type='text'>
The current codebase makes use of the zero-length array language extension
to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning in
case the flexible array does not occur last in the structure, which will
help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by this
change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied.  As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Link: http://lkml.kernel.org/r/20200213152241.GA877@embeddedor
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>gcov: clang support</title>
<updated>2019-05-15T02:52:51Z</updated>
<author>
<name>Greg Hackmann</name>
<email>ghackmann@android.com</email>
</author>
<published>2019-05-14T22:45:31Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=e178a5beb36960902379040ee0b667fb0a8eee93'/>
<id>urn:sha1:e178a5beb36960902379040ee0b667fb0a8eee93</id>
<content type='text'>
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().

[akpm@linux-foundation.org: coding-style fixes]
Link: http://lkml.kernel.org/r/20190417225328.208129-1-trong@android.com
Signed-off-by: Greg Hackmann &lt;ghackmann@android.com&gt;
Signed-off-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Signed-off-by: Tri Vo &lt;trong@android.com&gt;
Co-developed-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Co-developed-by: Tri Vo &lt;trong@android.com&gt;
Tested-by: Trilok Soni &lt;tsoni@quicinc.com&gt;
Tested-by: Prasad Sodagudi &lt;psodagud@quicinc.com&gt;
Tested-by: Tri Vo &lt;trong@android.com&gt;
Tested-by: Daniel Mentz &lt;danielmentz@google.com&gt;
Tested-by: Petri Gynther &lt;pgynther@google.com&gt;
Reviewed-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
