From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C604CA04FD; Fri, 9 Dec 2022 23:38:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 64D5B410FB; Fri, 9 Dec 2022 23:38:54 +0100 (CET) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mails.dpdk.org (Postfix) with ESMTP id D4EB040A8B for ; Fri, 9 Dec 2022 23:38:52 +0100 (CET) Received: by mail-pf1-f175.google.com with SMTP id x66so4709574pfx.3 for ; Fri, 09 Dec 2022 14:38:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=J+opgb9hBAf66a/Ex13g0o4ernjmtjpZDGDlK+6Muzw=; b=LGWdXFVnw/kJkZ40brLn2QQd/lhNwQJ10w256HAwQEpWTwTyjlKV81SVoS+0zrlX3i jn0oiT5HXiNJr3Lkk0i+AxwIcqmSCvUQoIeVouR4euSrbEygAOKto9kEK34jCtsR9hRe daEqrDcrqKttb83xoac4yKEgLtCDs0sk1LoT9wUchf/3Y+35giTY1F73JpWFrcZKLFAq pyIdl3r4KO54iJqjeShwBeOk1f6RlJyrQMivngNaNxLAzSoZKnt0gMMw8xgHU2w/4SmU JX5eboikyg5LBAOYIQ9q6Y3vgvjTxCnNjiMv4fcWgNIoBK7NxDyLLsEBUtzzjR8npEnq qTpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J+opgb9hBAf66a/Ex13g0o4ernjmtjpZDGDlK+6Muzw=; b=SHRUcBxMZ/lOL62xQnspe1CBpY9qFxD7rdx5bnm9EVVl7P91eip8etQTqK1mZtlBVv 0IkCkIp81zH98nxzoY2Sis9I6288HTXau4YAkm/Asez/gFlEFe/kqLWgZGoJDhBBsOi2 Q21uty9mAGEEWoeQMEkZRTrw3ph19z8ZajaJTmy3D09kBIY2R9urXPZDVrqtvfYNsxMN 1vPjYsBlFoHvQBP76kBGwNcph5YnpJD+HGpWo1HBKJHg9KmpXdzTw6lHNbyEgYrrz3jn 9hpwIakwFrhA5zDdM5Xt3E68SKHkxLjypQ+eLBm0yJiMTbTJEN5RfTjSCNp1DnHA66vE o6ZA== X-Gm-Message-State: ANoB5pmkNqDiQwpBm9PvfmHF8bFYJhqPax8BunWz7YQ/kCI0mjOGiByC mVy2mrzmD4U4vq0s50ijgX1flQ== X-Google-Smtp-Source: AA0mqf4PoESrAmwt8Ici3zpqZXdUqO3Bgc+UcYMnqpKJt+3w60k+4HF/6AreLCO/YVJZuKc37fdB8A== X-Received: by 2002:a62:17cf:0:b0:577:50c4:6dbe with SMTP id 198-20020a6217cf000000b0057750c46dbemr7557271pfx.4.1670625531722; Fri, 09 Dec 2022 14:38:51 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id 13-20020a62170d000000b00574de4a2fc7sm1653404pfx.205.2022.12.09.14.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 14:38:51 -0800 (PST) Date: Fri, 9 Dec 2022 14:38:49 -0800 From: Stephen Hemminger To: Thomas Monjalon Cc: Tyler Retzlaff , Morten =?UTF-8?B?QnI=?= =?UTF-8?B?w7hydXA=?= , dev@dpdk.org, david.marchand@redhat.com, Bruce Richardson Subject: Re: help with pthread_t deprecation / api changes Message-ID: <20221209143849.137b1202@hermes.local> In-Reply-To: <17965272.sWSEgdgrri@thomas> References: <20221130225427.GA13682@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <2146119.C4sosBPzcN@thomas> <20221209084814.3b1479d5@hermes.local> <17965272.sWSEgdgrri@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, 09 Dec 2022 22:14:33 +0100 Thomas Monjalon wrote: > 09/12/2022 17:48, Stephen Hemminger: > > On Fri, 09 Dec 2022 08:53:57 +0100 > > Thomas Monjalon wrote: > > > > > > > If some execution environment doesn't support thread names, it could return a string that makes it possible for a human to identify the thread, e.g. the tread id. Again, this is assuming that it is only used for debugging, trace, and similar. > > > > > > > > i think this raises a good question. is the purpose of setting a thread name > > > > meant to be something we can use from the application or is it something that > > > > is for debugging diagnostics and may be a best effort? > > > > > > I think yes it is only for debugging. > > > So best effort looks to be a good approach. > > > I'm not sure you need to replace the functions. > > > Can you just complete the implementations? > > > > > > Surprisingly, thread names are not preserved in core dumps. > > The core dump standard used by Linux does not put thread name in the image. > > Since this is a ELF ABI unlikely to be ever be added. > > What is missing exactly to have thread name in the core dump? > > Linux core dump file format is ELF. The thread info is storewd in the file notes as NT_PRPSINFO which contains info but not the thread name. In the kernel thread name is under comm. typedef struct prpsinfo { /* Information about process */ unsigned char pr_state; /* Numeric process state */ char pr_sname; /* Char for pr_state */ unsigned char pr_zomb; /* Zombie */ signed char pr_nice; /* Nice val */ unsigned long pr_flag; /* Flags */ uint32_t pr_uid; /* User ID */ uint32_t pr_gid; /* Group ID */ pid_t pr_pid; /* Process ID */ pid_t pr_ppid; /* Parent's process ID */ pid_t pr_pgrp; /* Group ID */ pid_t pr_sid; /* Session ID */ char pr_fname[16]; /* Filename of executable */ char pr_psargs[80]; /* Initial part of arg list */ } prpsinfo; Stack Overflow leads to this pages https://www.gabriel.urdhr.fr/2015/05/29/core-file/ https://uhlo.blogspot.com/2012/05/brief-look-into-core-dumps.html Only know this because of investigating how to get thread names to show up in Azure with Watson.