From owner-freebsd-hackers@freebsd.org Mon Apr 30 14:17:18 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 92050FAC805 for ; Mon, 30 Apr 2018 14:17:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 237E469E74 for ; Mon, 30 Apr 2018 14:17:17 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 0841fed5-4c81-11e8-bb8e-b35b57339d60 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 0841fed5-4c81-11e8-bb8e-b35b57339d60; Mon, 30 Apr 2018 14:16:11 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w3UEH9SU035307; Mon, 30 Apr 2018 08:17:09 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1525097829.57768.140.camel@freebsd.org> Subject: Re: Getting pthread names From: Ian Lepore To: Manuel =?ISO-8859-1?Q?St=FChn?= , freebsd-hackers@freebsd.org Date: Mon, 30 Apr 2018 08:17:09 -0600 In-Reply-To: <20180430111434.GA18085@freebsd-t450.fritz.box> References: <20180430111434.GA18085@freebsd-t450.fritz.box> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit 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 14:17:18 -0000 On Mon, 2018-04-30 at 13:14 +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? The applications I know of that can display thread names (ps, top, procstat) retrieve it using libprocstat and the procstat_getprocs(3) function. The libprocstat functions access the information via /dev/kvm or sysctl, but those interfaces return raw binary kernel data that userland should not try to directly interpret for themselves. -- Ian