diff options
Diffstat (limited to 'usr/src/cmd/svc/startd')
-rw-r--r-- | usr/src/cmd/svc/startd/graph.c | 14 | ||||
-rw-r--r-- | usr/src/cmd/svc/startd/method.c | 4 | ||||
-rw-r--r-- | usr/src/cmd/svc/startd/restarter.c | 16 | ||||
-rw-r--r-- | usr/src/cmd/svc/startd/wait.c | 5 |
4 files changed, 32 insertions, 7 deletions
diff --git a/usr/src/cmd/svc/startd/graph.c b/usr/src/cmd/svc/startd/graph.c index 30881ea34a..fa5cbed73a 100644 --- a/usr/src/cmd/svc/startd/graph.c +++ b/usr/src/cmd/svc/startd/graph.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, Joyent, Inc. All rights reserved. + * Copyright 2018 Joyent, Inc. * Copyright (c) 2015, Syneto S.R.L. All rights reserved. * Copyright 2016 Toomas Soome <tsoome@me.com> * Copyright 2016 RackTop Systems. @@ -579,7 +579,7 @@ typedef enum { typedef int (*graph_walk_cb_t)(graph_vertex_t *, void *); typedef struct graph_walk_info { - graph_walk_dir_t gi_dir; + graph_walk_dir_t gi_dir; uchar_t *gi_visited; /* vertex bitmap */ int (*gi_pre)(graph_vertex_t *, void *); void (*gi_post)(graph_vertex_t *, void *); @@ -3852,6 +3852,8 @@ run_sulogin(const char *msg) static void * sulogin_thread(void *unused) { + (void) pthread_setname_np(pthread_self(), "sulogin"); + MUTEX_LOCK(&dgraph_lock); assert(sulogin_thread_running); @@ -3879,6 +3881,8 @@ single_user_thread(void *unused) char *buf; int r; + (void) pthread_setname_np(pthread_self(), "single_user"); + MUTEX_LOCK(&single_user_thread_lock); single_user_thread_count++; @@ -5796,6 +5800,8 @@ graph_event_thread(void *unused) scf_handle_t *h; int err; + (void) pthread_setname_np(pthread_self(), "graph_event"); + h = libscf_handle_create_bound_loop(); /*CONSTCOND*/ @@ -6155,6 +6161,8 @@ graph_thread(void *arg) scf_handle_t *h; int err; + (void) pthread_setname_np(pthread_self(), "graph"); + h = libscf_handle_create_bound_loop(); if (st->st_initial) @@ -6812,6 +6820,8 @@ repository_event_thread(void *unused) int r; int fd; + (void) pthread_setname_np(pthread_self(), "repository_event"); + h = libscf_handle_create_bound_loop(); pg = safe_scf_pg_create(h); diff --git a/usr/src/cmd/svc/startd/method.c b/usr/src/cmd/svc/startd/method.c index c3cd0144c1..1d8ffaa2b6 100644 --- a/usr/src/cmd/svc/startd/method.c +++ b/usr/src/cmd/svc/startd/method.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 Joyent, Inc. All rights reserved. + * Copyright 2018 Joyent, Inc. */ /* @@ -1135,6 +1135,8 @@ method_thread(void *arg) boolean_t retryable; restarter_str_t reason; + (void) pthread_setname_np(pthread_self(), "method"); + assert(0 <= info->sf_method_type && info->sf_method_type <= 2); /* Get (and lock) the restarter_inst_t. */ diff --git a/usr/src/cmd/svc/startd/restarter.c b/usr/src/cmd/svc/startd/restarter.c index 676cded1c8..a98c863fb5 100644 --- a/usr/src/cmd/svc/startd/restarter.c +++ b/usr/src/cmd/svc/startd/restarter.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright 2018 Joyent, Inc. */ /* @@ -994,6 +994,8 @@ restarter_post_fsminimal_thread(void *unused) scf_handle_t *h; int r; + (void) pthread_setname_np(pthread_self(), "restarter_post_fsmin"); + h = libscf_handle_create_bound_loop(); for (;;) { @@ -1771,6 +1773,8 @@ restarter_process_events(void *arg) char *fmri = (char *)arg; struct timespec to; + (void) pthread_setname_np(pthread_self(), "restarter_process_events"); + assert(fmri != NULL); h = libscf_handle_create_bound_loop(); @@ -1939,8 +1943,8 @@ out: } static int -is_admin_event(restarter_event_type_t t) { - +is_admin_event(restarter_event_type_t t) +{ switch (t) { case RESTARTER_EVENT_TYPE_ADMIN_MAINT_ON: case RESTARTER_EVENT_TYPE_ADMIN_MAINT_ON_IMMEDIATE: @@ -1985,6 +1989,8 @@ restarter_event_thread(void *unused) { scf_handle_t *h; + (void) pthread_setname_np(pthread_self(), "restarter_event"); + /* * This is a new thread, and thus, gets its own handle * to the repository. @@ -2196,6 +2202,8 @@ restarter_contracts_event_thread(void *unused) int fd, err; scf_handle_t *local_handle; + (void) pthread_setname_np(pthread_self(), "restarter_contracts_event"); + /* * Await graph load completion. That is, stop here, until we've scanned * the repository for contract - instance associations. @@ -2545,6 +2553,8 @@ restarter_timeouts_event_thread(void *unused) * is not empty. */ + (void) pthread_setname_np(pthread_self(), "restarter_timeouts_event"); + /*CONSTCOND*/ while (1) { /* diff --git a/usr/src/cmd/svc/startd/wait.c b/usr/src/cmd/svc/startd/wait.c index ebd83be10e..12856ff639 100644 --- a/usr/src/cmd/svc/startd/wait.c +++ b/usr/src/cmd/svc/startd/wait.c @@ -21,7 +21,8 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * Copyright 2012, Joyent, Inc. All rights reserved. + * + * Copyright 2018 Joyent, Inc. */ /* @@ -252,6 +253,8 @@ wait_register(pid_t pid, const char *inst_fmri, int am_parent, int direct) void * wait_thread(void *args) { + (void) pthread_setname_np(pthread_self(), "wait"); + for (;;) { port_event_t pe; int fd; |