summaryrefslogtreecommitdiff
path: root/usr/src/tools/ctf
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2018-06-04 12:17:31 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2018-06-04 12:17:31 +0000
commitd92bd801c8a44e0078140b3de6ba6ba00d17aefc (patch)
tree0dffb550ddc95dca58c9cae25cfc798fe4cdcf85 /usr/src/tools/ctf
parenta8ebca982427512b990db033e77275f1c5caea83 (diff)
parentdb1c88f6dab43484b6c33636600ac4596ff4c354 (diff)
downloadillumos-joyent-d92bd801c8a44e0078140b3de6ba6ba00d17aefc.tar.gz
[illumos-gate merge]
commit db1c88f6dab43484b6c33636600ac4596ff4c354 9576 hid_attach is missing one mutex_exit in error path commit ea4ea50f064c5468142b24627acad09a41f060cb 9565 ctf: cast between incompatible function types commit a19d2449c7801a22d6c8370a965dab3d16c77925 9538 rcapd make install fails due to race in subdirs (fix isaexec) commit 6cfa0a7079eb1baa0a742f1e4def7cdabc8dcdab 9042 multiples of tty streams modules cause weirdness commit 207bc6d049369709a154c840750e0a74a9ff0a76 9544 loader: i386/Makefile should have target all before other targets commit 62877672b62bfe1e971061803b2a9c64897c13c3 9536 sasinfo does not know about 12gb sas commit 0f8051a0844ba1894eab81d4b73a76feca23554e 9533 8079's check for Xen HVM is incomplete commit d9241f995480d9097812b34500484c0fff9d7528 9552 grep segfaults when you ask for context commit fe12dc752b42da16028a16f4226e5295506fdb28 9529 libefi: efi_alloc_and_read should check for PMBR commit e53a4a814812099ec255c98f18f7ae1d0639ae57 9279 libefi: use one-line-per-file pattern in Makefile commit dec267e7ea9828898b1c64462daa6636c4ef5e29 9454 ::zfs_blkstats should count embedded blocks commit fe3ba4d1227d8746116ece7240682b13595c3142 9424 ztest failure: "unprotected error in call to Lua API (Invalid value type 'function' for key 'error')" commit cfd63e1b1bcf7ba4bf72f55ddbd87ce008d2986d 9486 reduce memory used by device removal on fragmented pools commit c7a7b2fa084facd68c3d1e860dfabe20c713877b 9479 fix wrong format specifier for vdev_id commit ddfe901b12348d31c500fb57f9174e88860a4061 9457 libzfs_import.c:add_config() has a memory leak commit 69d4acec15909325d6df21fec172510a50f77a8a 9538 rcapd make install fails due to race in subdirs
Diffstat (limited to 'usr/src/tools/ctf')
-rw-r--r--usr/src/tools/ctf/cvt/ctfmerge.c9
-rw-r--r--usr/src/tools/ctf/cvt/ctftools.h13
-rw-r--r--usr/src/tools/ctf/cvt/iidesc.c23
-rw-r--r--usr/src/tools/ctf/cvt/st_parse.c2
-rw-r--r--usr/src/tools/ctf/cvt/stabs.c6
-rw-r--r--usr/src/tools/ctf/cvt/tdata.c14
6 files changed, 36 insertions, 31 deletions
diff --git a/usr/src/tools/ctf/cvt/ctfmerge.c b/usr/src/tools/ctf/cvt/ctfmerge.c
index b8053a7a23..d2db789e5f 100644
--- a/usr/src/tools/ctf/cvt/ctfmerge.c
+++ b/usr/src/tools/ctf/cvt/ctfmerge.c
@@ -504,9 +504,11 @@ worker_runphase2(workqueue_t *wq)
/*
* Main loop for worker threads.
*/
-static void
-worker_thread(workqueue_t *wq)
+static void *
+worker_thread(void *ptr)
{
+ workqueue_t *wq = ptr;
+
worker_runphase1(wq);
debug(2, "%d: entering first barrier\n", pthread_self());
@@ -530,6 +532,7 @@ worker_thread(workqueue_t *wq)
debug(2, "%d: phase 1 complete\n", pthread_self());
worker_runphase2(wq);
+ return (NULL);
}
/*
@@ -692,7 +695,7 @@ start_threads(workqueue_t *wq)
for (i = 0; i < wq->wq_nthreads; i++) {
pthread_create(&wq->wq_thread[i], NULL,
- (void *(*)(void *))worker_thread, wq);
+ worker_thread, wq);
}
sigset(SIGINT, handle_sig);
diff --git a/usr/src/tools/ctf/cvt/ctftools.h b/usr/src/tools/ctf/cvt/ctftools.h
index 755af5176d..da02df8c94 100644
--- a/usr/src/tools/ctf/cvt/ctftools.h
+++ b/usr/src/tools/ctf/cvt/ctftools.h
@@ -69,11 +69,11 @@ extern "C" {
#endif
#ifndef MAX
-#define MAX(a, b) ((a) < (b) ? (b) : (a))
+#define MAX(a, b) ((a) < (b) ? (b) : (a))
#endif
#ifndef MIN
-#define MIN(a, b) ((a) > (b) ? (b) : (a))
+#define MIN(a, b) ((a) > (b) ? (b) : (a))
#endif
#define TRUE 1
@@ -282,13 +282,13 @@ typedef enum iitype {
typedef struct iidesc {
iitype_t ii_type;
char *ii_name;
- tdesc_t *ii_dtype;
+ tdesc_t *ii_dtype;
char *ii_owner; /* File that defined this node */
int ii_flags;
/* Function arguments (if any) */
int ii_nargs;
- tdesc_t **ii_args;
+ tdesc_t **ii_args;
int ii_vargs; /* Function uses varargs */
} iidesc_t;
@@ -369,14 +369,15 @@ void iter_iidescs_by_name(tdata_t *, const char *,
iidesc_t *iidesc_dup(iidesc_t *);
iidesc_t *iidesc_dup_rename(iidesc_t *, char const *, char const *);
void iidesc_add(hash_t *, iidesc_t *);
-void iidesc_free(iidesc_t *, void *);
+void iidesc_free(iidesc_t *);
+void iidesc_free_cb(void *, void *);
int iidesc_count_type(void *, void *);
void iidesc_stats(hash_t *);
int iidesc_dump(iidesc_t *);
/* input.c */
typedef enum source_types {
- SOURCE_NONE = 0,
+ SOURCE_NONE = 0,
SOURCE_UNKNOWN = 1,
SOURCE_C = 2,
SOURCE_S = 4
diff --git a/usr/src/tools/ctf/cvt/iidesc.c b/usr/src/tools/ctf/cvt/iidesc.c
index b6b9a0c7f2..0d75e3f852 100644
--- a/usr/src/tools/ctf/cvt/iidesc.c
+++ b/usr/src/tools/ctf/cvt/iidesc.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Routines for manipulating iidesc_t structures
*/
@@ -99,7 +97,7 @@ iidesc_add(hash_t *hash, iidesc_t *new)
bcopy(new, old, sizeof (*old));
bcopy(&tmp, new, sizeof (*new));
- iidesc_free(new, NULL);
+ iidesc_free(new);
return;
}
@@ -151,17 +149,22 @@ iidesc_dup_rename(iidesc_t *src, char const *name, char const *owner)
/*ARGSUSED*/
void
-iidesc_free(iidesc_t *idp, void *private)
+iidesc_free_cb(void *ptr, void *private)
{
- if (idp->ii_name)
- free(idp->ii_name);
- if (idp->ii_nargs)
- free(idp->ii_args);
- if (idp->ii_owner)
- free(idp->ii_owner);
+ iidesc_t *idp = ptr;
+
+ free(idp->ii_name);
+ free(idp->ii_args);
+ free(idp->ii_owner);
free(idp);
}
+void
+iidesc_free(iidesc_t *idp)
+{
+ iidesc_free_cb(idp, NULL);
+}
+
int
iidesc_dump(iidesc_t *ii)
{
diff --git a/usr/src/tools/ctf/cvt/st_parse.c b/usr/src/tools/ctf/cvt/st_parse.c
index 1530734a48..03facfd5cb 100644
--- a/usr/src/tools/ctf/cvt/st_parse.c
+++ b/usr/src/tools/ctf/cvt/st_parse.c
@@ -448,7 +448,7 @@ parse_stab(stab_t *stab, char *cp, iidesc_t **iidescp)
bzero(&resetbuf, sizeof (resetbuf));
if (rc < 0 || ii->ii_type == II_NOT) {
- iidesc_free(ii, NULL);
+ iidesc_free(ii);
return (rc);
}
diff --git a/usr/src/tools/ctf/cvt/stabs.c b/usr/src/tools/ctf/cvt/stabs.c
index f7b3034c64..53b4565859 100644
--- a/usr/src/tools/ctf/cvt/stabs.c
+++ b/usr/src/tools/ctf/cvt/stabs.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Routines used to read stabs data from a file, and to build a tdata structure
* based on the interesting parts of that data.
@@ -331,7 +329,7 @@ stabs_read(tdata_t *td, Elf *elf, const char *file)
*/
if (scope && stab->n_type != N_PSYM) {
if (iidescp)
- iidesc_free(iidescp, NULL);
+ iidesc_free(iidescp);
goto parse_loop_end;
}
@@ -356,7 +354,7 @@ stabs_read(tdata_t *td, Elf *elf, const char *file)
case II_PSYM:
fnarg_add(curfun, iidescp);
- iidesc_free(iidescp, NULL);
+ iidesc_free(iidescp);
break;
default:
aborterr("invalid ii_type %d for stab type %d",
diff --git a/usr/src/tools/ctf/cvt/tdata.c b/usr/src/tools/ctf/cvt/tdata.c
index 295928586e..ca71168bcf 100644
--- a/usr/src/tools/ctf/cvt/tdata.c
+++ b/usr/src/tools/ctf/cvt/tdata.c
@@ -246,22 +246,22 @@ static void (*free_cbs[])(tdesc_t *) = {
};
/*ARGSUSED1*/
-static int
-tdesc_free_cb(tdesc_t *tdp, void *private)
+static void
+tdesc_free_cb(void *ptr, void *private)
{
+ tdesc_t *tdp = ptr;
+
if (tdp->t_name)
free(tdp->t_name);
if (free_cbs[tdp->t_type])
free_cbs[tdp->t_type](tdp);
free(tdp);
-
- return (1);
}
void
tdesc_free(tdesc_t *tdp)
{
- (void) tdesc_free_cb(tdp, NULL);
+ tdesc_free_cb(tdp, NULL);
}
static int
@@ -390,8 +390,8 @@ tdata_new(void)
void
tdata_free(tdata_t *td)
{
- hash_free(td->td_iihash, (void (*)())iidesc_free, NULL);
- hash_free(td->td_layouthash, (void (*)())tdesc_free_cb, NULL);
+ hash_free(td->td_iihash, iidesc_free_cb, NULL);
+ hash_free(td->td_layouthash, tdesc_free_cb, NULL);
hash_free(td->td_idhash, NULL, NULL);
list_free(td->td_fwdlist, NULL, NULL);