public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/toolchain/binutils-patches:master commit in: 9999/
Date: Thu, 06 Mar 2025 04:54:55 +0000 (UTC)	[thread overview]
Message-ID: <1741236890.cede467b7d5956b862883d790f438efbaca7a8b7.sam@gentoo> (raw)

commit:     cede467b7d5956b862883d790f438efbaca7a8b7
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  6 04:54:09 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Mar  6 04:54:50 2025 +0000
URL:        https://gitweb.gentoo.org/proj/toolchain/binutils-patches.git/commit/?id=cede467b

9999: revert gprof patch breaking glibc gmon tests

Bug: https://sourceware.org/PR32764
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...f-only-process-line-numbers-for-intersect.patch | 179 +++++++++++++++++++++
 1 file changed, 179 insertions(+)

diff --git a/9999/0005-Revert-gprof-only-process-line-numbers-for-intersect.patch b/9999/0005-Revert-gprof-only-process-line-numbers-for-intersect.patch
new file mode 100644
index 0000000..210438d
--- /dev/null
+++ b/9999/0005-Revert-gprof-only-process-line-numbers-for-intersect.patch
@@ -0,0 +1,179 @@
+From d7ccec5522b6c7f61c95c7db4d1d91ff17cd1a31 Mon Sep 17 00:00:00 2001
+Message-ID: <d7ccec5522b6c7f61c95c7db4d1d91ff17cd1a31.1741236819.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Thu, 6 Mar 2025 04:53:27 +0000
+Subject: [PATCH] Revert "gprof: only process line numbers for intersection of
+ vmas and histograms"
+
+This reverts commit b8189cf9e40bd90502c9a2ce0df39dd54419bea4.
+
+Bug: https://sourceware.org/PR32764
+---
+ gprof/corefile.c | 96 +++++++++++++++++++++++-------------------------
+ gprof/gprof.c    | 23 ++++++------
+ 2 files changed, 56 insertions(+), 63 deletions(-)
+
+diff --git a/gprof/corefile.c b/gprof/corefile.c
+index a8970b3200d..bc26bd7883e 100644
+--- a/gprof/corefile.c
++++ b/gprof/corefile.c
+@@ -755,9 +755,8 @@ core_create_line_syms (void)
+   Sym prev, *sym;
+   const char *filename;
+   Sym_Table ltab;
++  bfd_vma vma_high;
+   size_t ltab_reserved;
+-  bfd_vma bfd_vma_low = core_text_sect->vma;
+-  bfd_vma bfd_vma_high = bfd_vma_low + bfd_section_size (core_text_sect);
+ 
+   /* Create symbols for functions as usual.  This is necessary in
+      cases where parts of a program were not compiled with -g.  For
+@@ -787,58 +786,53 @@ core_create_line_syms (void)
+      lot cleaner now.  */
+   memset (&prev, 0, sizeof (prev));
+ 
+-  for (size_t i = 0; i < num_histograms; ++i)
++  vma_high = core_text_sect->vma + bfd_section_size (core_text_sect);
++  for (vma = core_text_sect->vma; vma < vma_high; vma += insn_boundary)
+     {
+-      bfd_vma hist_vma_high = histograms[i].highpc;
+-      bfd_vma vma_low = MAX (histograms[i].lowpc, bfd_vma_low);
+-      bfd_vma vma_high = MIN (bfd_vma_high, hist_vma_high);
+-      for (vma = vma_low; vma < vma_high; vma += insn_boundary)
++      if (ltab.len >= ltab_reserved)
+ 	{
+-	  if (ltab.len >= ltab_reserved)
+-	    {
+-	      /* Reserve more space for line symbols.  */
+-	      ltab_reserved *= 2;
+-	      ltab.base = xrealloc (ltab.base, ltab_reserved * sizeof (Sym));
+-	      ltab.limit = ltab.base + ltab.len;
+-	    }
+-	  sym_init (ltab.limit);
+-
+-	  if (!get_src_info (vma, &filename, &ltab.limit->name, &ltab.limit->line_num)
+-	      || (prev.name && prev.line_num == ltab.limit->line_num
+-		  && strcmp (prev.name, ltab.limit->name) == 0
+-		  && filename_cmp (prev.file->name, filename) == 0))
+-	    continue;
+-
+-	  /* Make name pointer a malloc'ed string.  */
+-	  ltab.limit->name = xstrdup (ltab.limit->name);
+-	  ltab.limit->file = source_file_lookup_path (filename);
+-
+-	  ltab.limit->addr = vma;
+-
+-	  /* Set is_static based on the enclosing function, using either:
+-	     1) the previous symbol, if it's from the same function, or
+-	     2) a symtab lookup.  */
+-	  if (prev.name && ltab.limit->file == prev.file
+-	      && strcmp (ltab.limit->name, prev.name) == 0)
+-	    {
+-	      ltab.limit->is_static = prev.is_static;
+-	    }
+-	  else
+-	    {
+-	      sym = sym_lookup(&symtab, ltab.limit->addr);
+-	      if (sym)
+-		ltab.limit->is_static = sym->is_static;
+-	    }
+-
+-	  prev = *ltab.limit;
+-
+-	  DBG (AOUTDEBUG, printf ("[core_create_line_syms] %lu %s 0x%lx\n",
+-				  (unsigned long) (ltab.limit - ltab.base),
+-				  ltab.limit->name,
+-				  (unsigned long) ltab.limit->addr));
+-	  ++ltab.limit;
+-	  ++ltab.len;
++	  /* Reserve more space for line symbols.  */
++	  ltab_reserved *= 2;
++	  ltab.base = (Sym *) xrealloc (ltab.base, ltab_reserved * sizeof (Sym));
++	  ltab.limit = ltab.base + ltab.len;
+ 	}
++      sym_init (ltab.limit);
++
++      if (!get_src_info (vma, &filename, &ltab.limit->name, &ltab.limit->line_num)
++	  || (prev.name && prev.line_num == ltab.limit->line_num
++	      && strcmp (prev.name, ltab.limit->name) == 0
++	      && filename_cmp (prev.file->name, filename) == 0))
++	continue;
++
++      /* Make name pointer a malloc'ed string.  */
++      ltab.limit->name = xstrdup (ltab.limit->name);
++      ltab.limit->file = source_file_lookup_path (filename);
++
++      ltab.limit->addr = vma;
++
++      /* Set is_static based on the enclosing function, using either:
++	 1) the previous symbol, if it's from the same function, or
++	 2) a symtab lookup.  */
++      if (ltab.limit->file == prev.file
++	  && strcmp (ltab.limit->name, prev.name) == 0)
++	{
++	  ltab.limit->is_static = prev.is_static;
++	}
++      else
++	{
++	  sym = sym_lookup(&symtab, ltab.limit->addr);
++          if (sym)
++	    ltab.limit->is_static = sym->is_static;
++	}
++
++      prev = *ltab.limit;
++
++      DBG (AOUTDEBUG, printf ("[core_create_line_syms] %lu %s 0x%lx\n",
++			      (unsigned long) (ltab.limit - ltab.base),
++			      ltab.limit->name,
++			      (unsigned long) ltab.limit->addr));
++      ++ltab.limit;
++      ++ltab.len;
+     }
+ 
+   /* Reserve space for function symbols and/or trim excess space.  */
+diff --git a/gprof/gprof.c b/gprof/gprof.c
+index d1cbf25fa28..9392575f747 100644
+--- a/gprof/gprof.c
++++ b/gprof/gprof.c
+@@ -527,6 +527,17 @@ This program is free software.  This program has absolutely no warranty.\n"));
+   if (ignore_direct_calls)
+     core_get_text_space (core_bfd);
+ 
++  /* Create symbols from core image.  */
++  if (external_symbol_table)
++    core_create_syms_from (external_symbol_table);
++  else if (line_granularity)
++    core_create_line_syms ();
++  else
++    core_create_function_syms ();
++
++  /* Translate sym specs into syms.  */
++  sym_id_parse ();
++
+   if (file_format == FF_PROF)
+     {
+       fprintf (stderr,
+@@ -546,18 +557,6 @@ This program is free software.  This program has absolutely no warranty.\n"));
+       while (optind++ < argc);
+     }
+ 
+-  /* Create symbols from core image.  */
+-  if (external_symbol_table)
+-    core_create_syms_from (external_symbol_table);
+-  else if (line_granularity)
+-    core_create_line_syms ();
+-  else
+-    core_create_function_syms ();
+-
+-  /* Translate sym specs into syms.  */
+-  sym_id_parse ();
+-
+-
+   /* If user did not specify output style, try to guess something
+      reasonable.  */
+   if (output_style == 0)
+
+base-commit: 34f65d9dee431f840b554a9de6de314cc22849d7
+-- 
+2.48.1
+


             reply	other threads:[~2025-03-06  4:54 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06  4:54 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-05-14  7:14 [gentoo-commits] proj/toolchain/binutils-patches:master commit in: 9999/ Sam James
2025-05-14  3:59 Sam James
2025-05-05  9:46 Sam James
2025-05-05  3:06 Sam James
2025-05-04 10:15 Sam James
2025-04-10 17:35 Sam James
2025-04-09  2:24 Sam James
2025-04-08  0:36 Sam James
2025-03-29 14:18 Sam James
2025-03-12 20:21 Sam James
2025-03-06 12:54 Sam James
2025-02-03 18:02 Andreas K. Hüttel
2025-01-14  2:09 Sam James
2025-01-13  6:11 Sam James
2025-01-02 13:48 Sam James
2025-01-01 14:05 Sam James
2024-12-26  1:21 Sam James
2024-12-24  6:27 Sam James
2024-12-21  0:09 Sam James
2024-08-03 22:43 Andreas K. Hüttel
2024-06-29 17:05 Andreas K. Hüttel
2024-06-29 16:32 Andreas K. Hüttel
2024-06-29 16:32 Andreas K. Hüttel
2024-06-28 21:48 Andreas K. Hüttel
2023-10-27  0:44 Sam James
2023-10-27  0:44 Sam James
2023-07-30 14:49 Andreas K. Hüttel
2023-07-28 16:23 Andreas K. Hüttel
2023-06-30  9:21 WANG Xuerui
2023-04-02 11:44 Andreas K. Hüttel
2023-01-05 16:22 Andreas K. Hüttel
2023-01-05 16:21 Andreas K. Hüttel
2023-01-03 23:03 Andreas K. Hüttel
2023-01-02 23:50 Andreas K. Hüttel
2022-10-08 12:15 WANG Xuerui
2022-07-29  7:55 WANG Xuerui
2022-01-15 22:27 Andreas K. Hüttel
2021-08-17 20:07 Andreas K. Hüttel
2021-07-30 23:25 Andreas K. Hüttel
2021-07-24 20:57 Andreas K. Hüttel
2021-07-20 19:53 Andreas K. Hüttel
2021-07-20 19:50 Andreas K. Hüttel
2021-07-06  7:04 Sergei Trofimovich
2021-07-06  7:04 Sergei Trofimovich
2021-07-06  7:04 Sergei Trofimovich
2020-07-25 17:27 Andreas K. Hüttel
2020-07-25 12:26 Andreas K. Hüttel
2020-07-25 12:23 Andreas K. Hüttel
2020-07-25 12:20 Andreas K. Hüttel
2020-05-19 21:12 Andreas K. Hüttel

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=1741236890.cede467b7d5956b862883d790f438efbaca7a8b7.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox