public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] elf: Wire up _dl_diagnostics_cpu_kernel
@ 2023-09-08 20:09 Florian Weimer
  2023-09-08 20:10 ` [PATCH 2/2] x86: Add generic CPUID data dumper to ld.so --list-diagnostics Florian Weimer
  0 siblings, 1 reply; 14+ messages in thread
From: Florian Weimer @ 2023-09-08 20:09 UTC (permalink / raw)
  To: libc-alpha

Some diagnostics information can only be retrieved in an OS-specific
manner.  This function does nothing at present.
---
 elf/Makefile                    |  1 +
 elf/dl-diagnostics-cpu-kernel.c | 24 ++++++++++++++++++++++++
 elf/dl-diagnostics.c            |  1 +
 elf/dl-diagnostics.h            |  4 ++++
 4 files changed, 30 insertions(+)
 create mode 100644 elf/dl-diagnostics-cpu-kernel.c

diff --git a/elf/Makefile b/elf/Makefile
index 9176cbf1e3..bcf85950d0 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -127,6 +127,7 @@ rtld-routines = \
   dl-compat \
   dl-diagnostics \
   dl-diagnostics-cpu \
+  dl-diagnostics-cpu-kernel \
   dl-diagnostics-kernel \
   dl-environ \
   dl-hwcaps \
diff --git a/elf/dl-diagnostics-cpu-kernel.c b/elf/dl-diagnostics-cpu-kernel.c
new file mode 100644
index 0000000000..f3251c5b79
--- /dev/null
+++ b/elf/dl-diagnostics-cpu-kernel.c
@@ -0,0 +1,24 @@
+/* Print CPU/kernel diagnostics data in ld.so.  Stub version.
+   Copyright (C) 2023 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <dl-diagnostics.h>
+
+void
+_dl_diagnostics_cpu_kernel (void)
+{
+}
diff --git a/elf/dl-diagnostics.c b/elf/dl-diagnostics.c
index d742cf0a99..48db1ac07b 100644
--- a/elf/dl-diagnostics.c
+++ b/elf/dl-diagnostics.c
@@ -255,6 +255,7 @@ _dl_print_diagnostics (char **environ)
 
   _dl_diagnostics_kernel ();
   _dl_diagnostics_cpu ();
+  _dl_diagnostics_cpu_kernel ();
 
   _exit (EXIT_SUCCESS);
 }
diff --git a/elf/dl-diagnostics.h b/elf/dl-diagnostics.h
index 8099b90951..5eda01b5e1 100644
--- a/elf/dl-diagnostics.h
+++ b/elf/dl-diagnostics.h
@@ -43,4 +43,8 @@ void _dl_diagnostics_kernel (void) attribute_hidden;
    _dl_print_diagnostics.  */
 void _dl_diagnostics_cpu (void) attribute_hidden;
 
+/* Print diagnostics data for the CPU(s), in a kernel-secific fashion.
+   Called from _dl_print_diagnostics.  */
+void _dl_diagnostics_cpu_kernel (void) attribute_hidden;
+
 #endif /* _DL_DIAGNOSTICS_H */

base-commit: 53df2ce6885da3d0e89e87dca7b095622296014f
-- 
2.41.0



^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH 0/2] Enhanced x86 CPU diagnostics
@ 2024-02-09 19:08 Florian Weimer
  2024-02-09 19:08 ` [PATCH 1/2] elf: Wire up _dl_diagnostics_cpu_kernel Florian Weimer
  0 siblings, 1 reply; 14+ messages in thread
From: Florian Weimer @ 2024-02-09 19:08 UTC (permalink / raw)
  To: libc-alpha; +Cc: Adhemerval Zanella

This is a repost of my brute-force CPUID dumper for the x86
architectures.

Adhemerval, do you still have concerns about this?  I think we need this
diagnostic aid somewhere, so that people can figure out why their IFUNC
resolvers etc. are not working as expected.

We have a request for adding some AArch64 diagnostic data, too, although
it is going to be much less.

Thanks,
Florian

Florian Weimer (2):
  elf: Wire up _dl_diagnostics_cpu_kernel
  x86: Add generic CPUID data dumper to ld.so --list-diagnostics

 elf/Makefile                                  |   1 +
 elf/dl-diagnostics-cpu-kernel.c               |  24 +
 elf/dl-diagnostics.c                          |   1 +
 elf/dl-diagnostics.h                          |   4 +
 manual/dynlink.texi                           |  86 +++-
 .../linux/x86/dl-diagnostics-cpu-kernel.c     | 457 ++++++++++++++++++
 6 files changed, 572 insertions(+), 1 deletion(-)
 create mode 100644 elf/dl-diagnostics-cpu-kernel.c
 create mode 100644 sysdeps/unix/sysv/linux/x86/dl-diagnostics-cpu-kernel.c


base-commit: 15de3d17e1d9da5d38efb0a87a82efbc5bda732d
-- 
2.43.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-02-09 19:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08 20:09 [PATCH 1/2] elf: Wire up _dl_diagnostics_cpu_kernel Florian Weimer
2023-09-08 20:10 ` [PATCH 2/2] x86: Add generic CPUID data dumper to ld.so --list-diagnostics Florian Weimer
2023-09-10 19:56   ` Noah Goldstein
2023-09-11  4:24     ` Florian Weimer
2023-09-11 16:16       ` Noah Goldstein
2023-09-11 16:25         ` Florian Weimer
2023-09-11 16:28           ` Noah Goldstein
2023-09-11 16:31             ` Noah Goldstein
2023-09-11 17:48             ` Florian Weimer
2023-09-11 18:35               ` Noah Goldstein
2023-09-11 16:08   ` Adhemerval Zanella Netto
2023-09-11 16:19     ` Florian Weimer
2023-09-11 16:41       ` Adhemerval Zanella Netto
2024-02-09 19:08 [PATCH 0/2] Enhanced x86 CPU diagnostics Florian Weimer
2024-02-09 19:08 ` [PATCH 1/2] elf: Wire up _dl_diagnostics_cpu_kernel Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).