From a539def58999a587fe42f5d42c48f261dcd489a7 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 24 Apr 2015 15:53:28 +0200 Subject: test_uuidd: add pid, tid and idx back to object Signed-off-by: Karel Zak --- tests/helpers/test_uuidd.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'tests/helpers') diff --git a/tests/helpers/test_uuidd.c b/tests/helpers/test_uuidd.c index 7a4f8eb97..f098c4ac4 100644 --- a/tests/helpers/test_uuidd.c +++ b/tests/helpers/test_uuidd.c @@ -47,7 +47,9 @@ typedef struct threadentry thread_t; /* this is in shared memory, keep it as small as possible */ struct objectentry { uuid_t uuid; - thread_t *thread; + pthread_t tid; + pid_t pid; + size_t idx; }; typedef struct objectentry object_t; @@ -123,7 +125,9 @@ static void *create_uuids(thread_t *th) object_t *obj = &objects[i]; object_uuid_create(obj); - obj->thread = th; + obj->tid = th->tid; + obj->pid = th->proc->pid; + obj->idx = th->index + i;; } return 0; } @@ -230,8 +234,9 @@ static void object_dump(size_t idx, object_t *obj) fprintf(stderr, "object[%zu]: {\n", idx); fprintf(stderr, " uuid: <%s>\n", p); - fprintf(stderr, " process: %d\n", obj->thread && obj->thread->proc ? (int) obj->thread->proc->pid : 0); - fprintf(stderr, " thread: %d\n", obj->thread ? (int) obj->thread->tid : 0); + fprintf(stderr, " idx: %zu\n", obj->idx); + fprintf(stderr, " process: %d\n", (int) obj->pid); + fprintf(stderr, " thread: %d\n", (int) obj->tid); fprintf(stderr, "}\n"); } @@ -289,7 +294,7 @@ int main(int argc, char *argv[]) object_t *obj1 = &objects[i], *obj2 = &objects[i + 1]; - if (!obj1->thread) { + if (!obj1->tid) { LOG(3, (stderr, "ignore unused object #%zu\n", i)); nignored++; continue; -- cgit v1.2.3-55-g7522