From owner-freebsd-hackers@freebsd.org Mon Apr 30 19:27:19 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D59CFB4664 for ; Mon, 30 Apr 2018 19:27:19 +0000 (UTC) (envelope-from freebsdnewbie@freenet.de) Received: from mout0.freenet.de (mout0.freenet.de [IPv6:2001:748:100:40::2:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "*.freenet.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3712E6FF46; Mon, 30 Apr 2018 19:27:19 +0000 (UTC) (envelope-from freebsdnewbie@freenet.de) Received: from [195.4.92.142] (helo=mjail2.freenet.de) by mout0.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (port 25) (Exim 4.90_1 #2) id 1fDESD-0007Ds-U5; Mon, 30 Apr 2018 21:27:17 +0200 Received: from [::1] (port=44966 helo=mjail2.freenet.de) by mjail2.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (Exim 4.90_1 #2) id 1fDESD-0001vH-QG; Mon, 30 Apr 2018 21:27:17 +0200 Received: from mx4.freenet.de ([195.4.92.14]:35468) by mjail2.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (Exim 4.90_1 #2) id 1fDEQ8-0008Pd-F5; Mon, 30 Apr 2018 21:25:08 +0200 Received: from p4fd9e53a.dip0.t-ipconnect.de ([79.217.229.58]:53633 helo=freebsd-t450.fritz.box) by mx4.freenet.de with esmtpsa (ID freebsdnewbie@freenet.de) (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (port 587) (Exim 4.90_1 #2) id 1fDEQ8-0008IU-B6; Mon, 30 Apr 2018 21:25:08 +0200 Date: Mon, 30 Apr 2018 21:25:06 +0200 From: Manuel =?iso-8859-15?Q?St=FChn?= To: Konstantin Belousov Cc: freebsd-hackers@freebsd.org Subject: Re: Getting pthread names Message-ID: <20180430192506.GA86258@freebsd-t450.fritz.box> References: <20180430111434.GA18085@freebsd-t450.fritz.box> <20180430135711.GT6887@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180430135711.GT6887@kib.kiev.ua> User-Agent: Mutt/1.9.5 (2018-04-13) X-Spamscore: -3.1 (---) X-Spamreport: Action: no action Symbol: NEURAL_HAM(-0.00) Symbol: ASN(0.00) Symbol: RCVD_VIA_SMTP_AUTH(0.00) Symbol: RCVD_TLS_ALL(0.00) Symbol: RCVD_COUNT_ONE(0.00) Symbol: FROM_HAS_DN(0.00) Symbol: FROM_EQ_ENVFROM(0.00) Symbol: BAYES_HAM(-3.00) Symbol: MIME_GOOD(-0.10) Symbol: TO_DN_SOME(0.00) Symbol: TO_MATCH_ENVRCPT_ALL(0.00) Symbol: RCPT_COUNT_TWO(0.00) Message-ID: 20180430192506.GA86258@freebsd-t450.fritz.box X-FN-Spambar: X-Originated-At: 79.217.229.58!53633 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 19:27:19 -0000 On Mon, Apr 30, 2018 at 04:57:11PM +0300, Konstantin Belousov wrote: >On Mon, Apr 30, 2018 at 01:14:34PM +0200, Manuel St?hn wrote: >> Hi, >> >> for setting a name for pthreads i found pthread_set_name_np(3), but for >> retrieving the name i found nothing. Is there any api like >> pthread_getname_np for FreeBSD? Or is there another way to retrieve the >> threads name within an application? > >Not like pthread_getname_np(), but still something. You can use >(binary) sysctl kern.proc.pid. to get struct kinfo_proc for all >threads. In the structure, the ki_tdname() member contains the thread >name as set by pthread_set_name_np(3). Thank you (all) for your answer(s) and hints! I'll have a look into this. BR Manuel