Skip to content

Commit 3317527

Browse files
author
Delphix Engineering
committed
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
2 parents 4aa6565 + 3fcff04 commit 3317527

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+3246
-11233
lines changed

Doxyfile

+1,000-505
Large diffs are not rendered by default.

Makefile.am

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121

2222
ACLOCAL_AMFLAGS = -I m4
2323

24-
SUBDIRS = include src tests examples
25-
if BUILD_PYTHON_EXT
26-
SUBDIRS += python
27-
endif
24+
SUBDIRS = include src tests tools examples
2825

2926
dist_noinst_DATA = \
3027
COPYING.GPLv2 \

NEWS

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
next
22
----
3+
* Remove legacy Python bindings. Use pykdumpfile instead.
4+
5+
0.5.5
6+
-----
37
* Incompatible API changes:
48
- kdump_get_typed_attr(): parameters and type mismatch behaviour
59
- kdump_attr_ref_get(): result must be discarded
@@ -8,6 +12,7 @@ next
812
* Parse QEMU CPU state ELF notes.
913
* Use kernel page tables when initializing X86-64 Linux with PTI from
1014
CR3 register value.
15+
* Include the kdumpid utility.
1116
* Fix direct mapping if LDT PTI remapping is used in Linux on X86-64.
1217
* Minor cache improvements and a NULL-pointer dereference fix.
1318
* Fix test suite for 32-bit architectures.

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ To compile this package, you'll need the following:
1919
* [GCC](http://gcc.gnu.org/). The source uses a few construct specific
2020
to GCC (such as variable attributes). Porting should be easy, though.
2121

22+
If you want to build kdumpid, you'll also need:
23+
24+
* [BFD](http://www.gnu.org/software/binutils/). Any version with
25+
disassemblers for x86, ppc and s390 will do. This usually comes with
26+
the distro packaged as binutils-devel or similar.
27+
2228
To create documentation files, you'll need:
2329

2430
* [Doxygen](http://www.doxygen.org/). Usually packaged as doxygen.
@@ -50,8 +56,7 @@ To generate the `configure` script, run
5056
Python
5157
------
5258

53-
This repository contains some manually written Python bindings. These are now
54-
deprecated in favour of a fresh rewrite using CFFI. See
59+
There are official Python bindings for `libkdumpfile`; see
5560
[pykdumpfile](https://github.com/ptesarik/pykdumpfile).
5661

5762
Making Releases

configure.ac

+11-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
dnl Package release versioning
2121
m4_define([pkg_major_version], [0])
2222
m4_define([pkg_minor_version], [5])
23-
m4_define([pkg_micro_version], [4])
23+
m4_define([pkg_micro_version], [5])
2424
m4_define([pkg_version],
2525
[pkg_major_version.pkg_minor_version.pkg_micro_version])
2626

27+
dnl FIXME: kdumpid has a different versioning scheme
28+
m4_define([kdumpid_major_version], [1])
29+
m4_define([kdumpid_minor_version], [7])
30+
2731
AC_INIT([libkdumpfile],[pkg_version],[[email protected]])
2832

2933
AC_CONFIG_SRCDIR([src/kdumpfile/diskdump.c])
@@ -101,8 +105,10 @@ AC_ARG_ENABLE(debug,
101105
AS_IF([test "x$enable_debug" = xyes],
102106
[AC_DEFINE(ENABLE_DEBUG, 1, Define to enable extra debugging features)])
103107

104-
dnl check for Python
105-
kdump_PYTHON([2.7.0])
108+
dnl check whether to build optional tools
109+
AC_SUBST(KDUMPID_VER_MAJOR, kdumpid_major_version)
110+
AC_SUBST(KDUMPID_VER_MINOR, kdumpid_minor_version)
111+
KDUMP_TOOL_KDUMPID
106112

107113
AC_CONFIG_FILES([
108114
Makefile
@@ -112,8 +118,9 @@ AC_CONFIG_FILES([
112118
src/Makefile
113119
src/addrxlat/Makefile
114120
src/kdumpfile/Makefile
115-
python/Makefile
116121
tests/Makefile
122+
tools/Makefile
123+
tools/kdumpid/Makefile
117124
libaddrxlat.pc
118125
libkdumpfile.pc
119126
include/libkdumpfile/kdumpfile.h

include/libkdumpfile/addrxlat.h.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ typedef uint_fast64_t addrxlat_pte_t;
134134
#define ADDRXLAT_PRIuPTE PRIuFAST64 /**< Decimal PTE */
135135
#define ADDRXLAT_PRIxPTE PRIxFAST64 /**< Lowercase hex PTE */
136136
#define ADDRXLAT_PRIXPTE PRIXFAST64 /**< Uppercase hex PTE */
137-
/* @} */
137+
/** @} */
138138

139139
/** Address spaces
140140
*

include/libkdumpfile/kdumpfile.h.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ typedef uint_fast64_t kdump_num_t;
8080
#define KDUMP_PRIuNUM PRIuFAST64 /**< Decimal @c kdump_num_t */
8181
#define KDUMP_PRIxNUM PRIxFAST64 /**< Lowercase hex @c kdump_num_t */
8282
#define KDUMP_PRIXNUM PRIXFAST64 /**< Uppercase hex @c kdump_num_t */
83-
/* @} */
83+
/** @} */
8484

8585
/** Type of a physical or virtual address.
8686
*
@@ -118,7 +118,7 @@ typedef kdump_addr_t kdump_vaddr_t;
118118
#define KDUMP_PRIuADDR ADDRXLAT_PRIuADDR /**< Decimal address */
119119
#define KDUMP_PRIxADDR ADDRXLAT_PRIxADDR /**< Lowercase hex address */
120120
#define KDUMP_PRIXADDR ADDRXLAT_PRIXADDR /**< Uppercase hex address */
121-
/* @} */
121+
/** @} */
122122

123123
/** Representation of a dump file.
124124
*
@@ -217,7 +217,7 @@ enum kdump_clone_bits {
217217
*/
218218
/** Do not share address translation. */
219219
#define KDUMP_CLONE_XLAT (1UL << KDUMP_CLONE_BIT_XLAT)
220-
/* @} */
220+
/** @} */
221221

222222
/** Clone a dump file object.
223223
* @param orig Original dump file object.
@@ -1034,7 +1034,7 @@ void kdump_attr_iter_end(kdump_ctx_t *ctx, kdump_attr_iter_t *iter);
10341034
#define KDUMP_ARCH_S390 "s390" /**< IBM z/Architecture, 31-bit */
10351035
#define KDUMP_ARCH_S390X "s390x" /**< IBM z/Architecture, 64-bit */
10361036
#define KDUMP_ARCH_X86_64 "x86_64" /**< AMD64, Intel 64 */
1037-
/* @} */
1037+
/** @} */
10381038

10391039
/** Byte order attribute.
10401040
* @sa kdump_byte_order_t

m4/python.m4

-42
This file was deleted.

m4/tools.m4

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# KDUMP_TRY_LINK(LIBRARIES)
2+
# ---------------------------------------------------------
3+
# Try to link the existing test source file with additional
4+
# libraries.
5+
# Set kdump_res to "yes" on success, else set it to "no".
6+
# Standard error output is saved to conftest.linkerr.
7+
AC_DEFUN([KDUMP_TRY_LINK],[dnl
8+
kdump_save_LIBS="$LIBS"
9+
kdump_save_ac_link="$ac_link"
10+
LIBS="$1 $LIBS"
11+
ac_link="$ac_link 2>conftest.linkerr"
12+
AC_LINK_IFELSE([], kdump_res=yes, [kdump_res=no
13+
$2])
14+
LIBS="$kdump_save_LIBS"
15+
ac_link="$kdump_save_ac_link"
16+
])# KDUMP_TRY_LINK
17+
18+
AC_DEFUN([KDUMP_REPORT_LINKERR],[dnl
19+
AS_ECHO("$as_me:$LINENO: all linker errors") >&AS_MESSAGE_LOG_FD
20+
cat conftest.linkerr >&AS_MESSAGE_LOG_FD
21+
])# KDUMP_REPORT_LINKERR
22+
23+
AC_DEFUN([KDUMP_TRY_LINK_UNDEF],[dnl
24+
kdump_save_LDFLAGS="$LDFLAGS"
25+
LDFLAGS="-z undefs $2 $LDFLAGS"
26+
KDUMP_TRY_LINK($1, KDUMP_REPORT_LINKERR)
27+
LDFLAGS="$kdump_save_LDFLAGS"
28+
])# KDUMP_TRY_LINK_UNDEF
29+
30+
AC_DEFUN([KDUMP_DIS_ASM_CHECK_UNDEF],[dnl
31+
AC_REQUIRE([AC_PROG_EGREP])dnl
32+
AC_MSG_CHECKING([whether disassembler requires $1])
33+
KDUMP_TRY_LINK($DIS_ASM_LIBS)
34+
AS_ECHO("$as_me:$LINENO: matching linker errors") >&AS_MESSAGE_LOG_FD
35+
AS_IF([$EGREP "@<:@^A-Za-z0-9_@:>@($2)" conftest.linkerr >&AS_MESSAGE_LOG_FD],
36+
[AC_MSG_RESULT(yes)
37+
DIS_ASM_LIBS="$DIS_ASM_LIBS $1"
38+
KDUMP_TRY_LINK_UNDEF($DIS_ASM_LIBS)
39+
AS_IF([test yes != "$kdump_res"],
40+
[AC_MSG_FAILURE([Link fails with $1])])],
41+
[AC_MSG_RESULT(no)])dnl
42+
])# KDUMP_DIS_ASM_CHECK_UNDEF
43+
44+
AC_DEFUN([KDUMP_DIS_ASM_LIBS],[dnl determine disassembler libraries
45+
DIS_ASM_LIBS=-lopcodes
46+
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
47+
[#include <dis-asm.h>],
48+
[disassembler(bfd_arch_i386, FALSE, bfd_mach_x86_64, NULL);])])
49+
dnl ignore undefined symbols from missing linker dependencies
50+
AC_MSG_CHECKING([for disassembler in $DIS_ASM_LIBS])
51+
KDUMP_TRY_LINK_UNDEF($DIS_ASM_LIBS, [-Wl,--require-defined=disassembler])
52+
AC_MSG_RESULT($kdump_res)
53+
AS_IF([test yes = "$kdump_res"], [dnl
54+
KDUMP_DIS_ASM_CHECK_UNDEF(-lbfd, bfd_)
55+
KDUMP_DIS_ASM_CHECK_UNDEF(-lsframe, sframe_)
56+
KDUMP_DIS_ASM_CHECK_UNDEF(-liberty, htab_create|splay_tree_new)
57+
KDUMP_DIS_ASM_CHECK_UNDEF(-lz, inflate)
58+
KDUMP_DIS_ASM_CHECK_UNDEF(-lzstd, ZSTD_)
59+
KDUMP_DIS_ASM_CHECK_UNDEF(-ldl, dlopen)
60+
AS_IF([test yes != "$kdump_res"],
61+
[KDUMP_REPORT_LINKERR]
62+
[AC_MSG_FAILURE([Tried everything, still cannot link disassembler.])])
63+
AC_SUBST(DIS_ASM_LIBS)
64+
])dnl
65+
])# KDUMP_DIS_ASM_LIBS
66+
67+
AC_DEFUN([KDUMP_DIS_ASM],[dnl determine disassembler options
68+
AC_CHECK_HEADERS(dis-asm.h, [],
69+
[AC_MSG_ERROR([Disassembler headers not found])])
70+
AC_MSG_CHECKING([whether disassembler supports syntax highlighting])
71+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
72+
#include <dis-asm.h>
73+
void fn(struct disassemble_info *info, void *stream,
74+
fprintf_ftype fprintf_func, fprintf_styled_ftype fprintf_styled_func)
75+
{
76+
init_disassemble_info(info, stream, fprintf_func, fprintf_styled_func);
77+
}
78+
])],
79+
[dnl
80+
AC_MSG_RESULT(yes)
81+
AC_DEFINE(DIS_ASM_STYLED_PRINTF, [1],
82+
[Define if init_disassemble_info() has a printf_styled_func parameter])],
83+
[AC_MSG_RESULT(no)])
84+
KDUMP_DIS_ASM_LIBS
85+
])# KDUMP_DIS_ASM
86+
87+
AC_DEFUN([KDUMP_TOOL_KDUMPID],[dnl enable/disable kdumpid build
88+
AC_ARG_ENABLE(kdumpid,
89+
[AS_HELP_STRING(--disable-kdumpid,
90+
[do not build kdumpid])],
91+
[],
92+
[enable_kdumpid=yes])
93+
AS_IF([test no != "$enable_kdumpid"], [dnl
94+
KDUMP_DIS_ASM
95+
AS_IF([test yes != "$kdump_res"],
96+
[AC_MSG_FAILURE(
97+
[disassembler test failed (--disable-kdumpid to disable)])]
98+
)])
99+
AM_CONDITIONAL(BUILD_KDUMPID, [test yes = "$enable_kdumpid"])
100+
])# KDUMP_TOOL_KDUMPID

python/.gitignore

-9
This file was deleted.

python/Makefile.am

-106
This file was deleted.

0 commit comments

Comments
 (0)