diff --git a/GNUmakefile b/GNUmakefile index 4371e46..2219cb9 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -2,7 +2,7 @@ # # Build files in subdirectories are included by this file. # -# Copyright 2011, 2012 Oracle, Inc. +# Copyright 2011, 2012, 2013, 2014, 2015 Oracle, Inc. # # Licensed under the GNU General Public License (GPL), version 2. See the file # COPYING in the top level of this tree. @@ -11,7 +11,7 @@ .SUFFIXES: PROJECT := libdtrace-ctf -VERSION := 0.4.0 +VERSION := 0.5.0 # Verify supported hardware. diff --git a/Makeoptions b/Makeoptions index cd7f041..54ce544 100644 --- a/Makeoptions +++ b/Makeoptions @@ -24,6 +24,7 @@ endif ifneq ($(coverage),no) override CFLAGS += -O0 --coverage +override LDFLAGS += --coverage endif ifeq ($(verbose),no) diff --git a/NEWS b/NEWS index 0706964..cbeba99 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,29 @@ +0.5.0 +----- + +libdtrace-ctf is now compatible with big-endian systems (like SPARC). + +0.4.3 +----- + +A pair of new functions, ctf_snapshot() and ctf_rollback(), provide type- +and-variable discarding functionality like that ctf_discard() did, but +without the expense of calling ctf_update() to get a point to discard to. + +0.4.2 +----- + +The build system is now compatible with GNU Make 4.0. + 0.4.1 ----- A bug causing reads of unintialized memory is fixed. +ctf_dump is much more useful, dumping information on structure and union members +recursively, and supporting a couple of extra flags that may be useful when +driving ctf_dump from another process. + 0.4.0 ----- diff --git a/libctf/ctf_create.c b/libctf/ctf_create.c index e46e993..bcddb80 100644 --- a/libctf/ctf_create.c +++ b/libctf/ctf_create.c @@ -1221,8 +1221,18 @@ enumcmp(const char *name, int value, void *arg) ctf_bundle_t *ctb = arg; int bvalue; - return (ctf_enum_value(ctb->ctb_file, ctb->ctb_type, - name, &bvalue) == CTF_ERR || value != bvalue); + if (ctf_enum_value(ctb->ctb_file, ctb->ctb_type, + name, &bvalue) == CTF_ERR) { + ctf_dprintf("Conflict due to member %s iteration error.\n", + name); + return 1; + } + if (value != bvalue) { + ctf_dprintf("Conflict due to value change: %i versus %i\n", + value, bvalue); + return 1; + } + return 0; } static int @@ -1241,8 +1251,18 @@ membcmp(const char *name, ctf_id_t type, ulong_t offset, void *arg) ctf_bundle_t *ctb = arg; ctf_membinfo_t ctm; - return (ctf_member_info(ctb->ctb_file, ctb->ctb_type, - name, &ctm) == CTF_ERR || ctm.ctm_offset != offset); + if (ctf_member_info(ctb->ctb_file, ctb->ctb_type, + name, &ctm) == CTF_ERR) { + ctf_dprintf("Conflict due to member %s iteration error.\n", + name); + return 1; + } + if (ctm.ctm_offset != offset) { + ctf_dprintf("Conflict due to member %s offset change: " + "%lx versus %lx\n", name, ctm.ctm_offset, offset); + return 1; + } + return 0; } static int @@ -1350,8 +1370,11 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type) */ if (dst_type != CTF_ERR && dst_kind != kind && ( dst_kind != CTF_K_FORWARD || (kind != CTF_K_ENUM && - kind != CTF_K_STRUCT && kind != CTF_K_UNION))) + kind != CTF_K_STRUCT && kind != CTF_K_UNION))) { + ctf_dprintf("Conflict for type %s: kinds differ, new: %i; " + "old (ID %lx): %i\n", name, kind, dst_type, dst_kind); return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + } /* * If the non-empty name was not found in the appropriate hash, search @@ -1396,8 +1419,14 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type) if (ctf_type_encoding(dst_fp, dst_type, &dst_en) != 0) return (CTF_ERR); /* errno is set for us */ - if (bcmp(&src_en, &dst_en, sizeof (ctf_encoding_t))) + if (bcmp(&src_en, &dst_en, sizeof (ctf_encoding_t))) { + ctf_dprintf("Conflict for type %s against ID %lx: " + "integer encodings differ, old %x/%x/%x; " + "new: %x/%x/%x\n", name, dst_type, + src_en.cte_format, src_en.cte_offset, src_en.cte_bits, + dst_en.cte_format, dst_en.cte_offset, dst_en.cte_bits); return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + } } else if (kind == CTF_K_INTEGER) { dst_type = ctf_add_integer(dst_fp, flag, name, &src_en); @@ -1436,8 +1465,14 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type) if (ctf_array_info(dst_fp, dst_type, &dst_ar) != 0) return (CTF_ERR); /* errno is set for us */ - if (bcmp(&src_ar, &dst_ar, sizeof (ctf_arinfo_t))) + if (bcmp(&src_ar, &dst_ar, sizeof (ctf_arinfo_t))) { + ctf_dprintf("Conflict for type %s against ID %lx: " + "array info differs, old %lx/%lx/%x; " + "new: %lx/%lx/%x\n", name, dst_type, + src_ar.ctr_contents, src_ar.ctr_index, src_ar.ctr_nelems, + dst_ar.ctr_contents, dst_ar.ctr_index, dst_ar.ctr_nelems); return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + } } else dst_type = ctf_add_array(dst_fp, flag, &src_ar); break; @@ -1469,11 +1504,19 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type) */ if (dst_type != CTF_ERR && dst_kind != CTF_K_FORWARD) { if (ctf_type_size(src_fp, src_type) != - ctf_type_size(dst_fp, dst_type)) + ctf_type_size(dst_fp, dst_type)) { + ctf_dprintf("Conflict for type %s against ID %lx: " + "union size differs, old %li, new %li\n", + name, dst_type, ctf_type_size(src_fp, src_type), + ctf_type_size(dst_fp, dst_type)); return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + } - if (ctf_member_iter(src_fp, src_type, membcmp, &dst)) + if (ctf_member_iter(src_fp, src_type, membcmp, &dst)) { + ctf_dprintf("Conflict for type %s against ID %lx: " + "members differ, see above\n", name, dst_type); return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + } break; } @@ -1522,8 +1565,11 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type) case CTF_K_ENUM: if (dst_type != CTF_ERR && dst_kind != CTF_K_FORWARD) { if (ctf_enum_iter(src_fp, src_type, enumcmp, &dst) || - ctf_enum_iter(dst_fp, dst_type, enumcmp, &src)) + ctf_enum_iter(dst_fp, dst_type, enumcmp, &src)) { + ctf_dprintf("Conflict for enum %s against ID %lx: " + "members differ, see above\n", name, dst_type); return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + } } else { dst_type = ctf_add_enum(dst_fp, flag, name); if ((dst.ctb_type = dst_type) == CTF_ERR || diff --git a/libdtrace-ctf.spec b/libdtrace-ctf.spec index 9c85a13..5f7c992 100644 --- a/libdtrace-ctf.spec +++ b/libdtrace-ctf.spec @@ -1,6 +1,6 @@ # spec file for package libdtrace-ctf # -# Copyright 2011, 2012, 2013 Oracle, Inc. +# Copyright 2011, 2012, 2013, 2014, 2015 Oracle, Inc. # # Licensed under the GNU General Public License (GPL), version 2. See the file # COPYING in the top level of this tree. @@ -9,12 +9,11 @@ BuildRequires: rpm Name: libdtrace-ctf License: GPLv2 Group: Development/Libraries -Provides: libdtrace-ctf Requires: gcc elfutils-libelf zlib BuildRequires: elfutils-libelf-devel kernel-headers glibc-headers zlib-devel Summary: Compact Type Format library. -Version: 0.4.0 -Release: 1 +Version: 0.5.0 +Release: 3%{?dist} Source: libdtrace-ctf-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: x86_64 sparc64 @@ -30,6 +29,7 @@ Kris van Hees %package devel Summary: Compact Type Format development headers. +Requires: %{name}%{?_isa} = %{version}-%{release} Requires: zlib-devel %description devel @@ -74,6 +74,21 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version} %{_includedir}/sys/ctf_api.h %changelog +* Fri Aug 14 2015 - nick.alcock@oracle.com - 0.5.0-3 +- Include the distribution in the RPM release. [Orabug: 21211461] +- No longer Provide: our own name. [Orabug: 21622263] +* Thu Apr 23 2015 - nick.alcock%oracle.com - 0.5.0-2 +- libdtrace-ctf-devel now depends on the appropriate version of libdtrace-ctf. +[Orabug: 20948460] +* Fri Mar 20 2015 - nick.alcock@oracle.com - 0.5.0 +- SPARC / big-endian support. [Orabug: 20762799] +* Tue Mar 17 2015 - nick.alcock@oracle.com - 0.4.3 +- New ctf_snapshot() and ctf_rollback() functions. [Orabug: 20229533] +* Mon Oct 13 2014 - nick.alcock@oracle.com - 0.4.2 +- Work with GNU Make 4.0. +* Tue Dec 17 2013 - nick.alcock@oracle.com - 0.4.1 +- Improvements to ctf_dump. +- No longer look off the end of strings when looking up types by name. * Tue Jul 23 2013 - nick.alcock@oracle.com - 0.4.0 - New ctf_dump tool and ctf_variable_iter() iteration function. * Wed Nov 28 2012 - kris.van.hees@oracle.com - 0.3.3