[1/2] elf: Wire up _dl_diagnostics_cpu_kernel

Message ID 717acf6159c0f8801f58f75dbdab844f7de2dbd5.1707505012.git.fweimer@redhat.com
State Dropped
Headers
Series Enhanced x86 CPU diagnostics |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Testing passed

Commit Message

Florian Weimer Feb. 9, 2024, 7:08 p.m. UTC
  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
  

Patch

diff --git a/elf/Makefile b/elf/Makefile
index 5d78b659ce..0ecf9e207c 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -130,6 +130,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 7345ebc4e5..352d68a759 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 1049a41118..8a3bc09815 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 */