Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751957AbbDWGz1 (ORCPT ); Thu, 23 Apr 2015 02:55:27 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:62585 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbbDWGzX (ORCPT ); Thu, 23 Apr 2015 02:55:23 -0400 X-AuditID: cbfee68e-f79c56d000006efb-8d-553897583bb6 Date: Thu, 23 Apr 2015 06:55:20 +0000 (GMT) From: Eunbong Song Subject: [PATCH] tools/liblockdep: change current_obj from thread-local storage to non thread-local storage To: sasha.levin@oracle.com Cc: "linux-kernel@vger.kernel.org" Reply-to: eunb.song@samsung.com MIME-version: 1.0 X-MTR: 20150423065329703@eunb.song Msgkey: 20150423065329703@eunb.song X-EPLocale: ko_KR.euc-kr X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-MLAttribute: X-RootMTR: 20150423065329703@eunb.song X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N X-ConfirmMail: N,general Content-type: text/plain; charset=euc-kr MIME-version: 1.0 Message-id: <1635690742.249841429772120132.JavaMail.weblogic@epmlwas03d> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMIsWRmVeSWpSXmKPExsVy+t8zPd2I6RahBrPm6Vlc3jWHzYHR4/Mm uQDGKC6blNSczLLUIn27BK6MT5f7WApu8VZsPFHTwLiCt4uRk0NIQEWi5f93xi5GDg4JAROJ tq4skLCEgJjEhXvr2boYuYBKljFK3H32lRkiYSLx9+w2JojEHEaJ7v6HzCDNLAKqEu+mSoLU sAloS/w4cBWsXlggW+LX3QOMILaIgLzE9o972UFsZgFHiUeX7zBD3CAvMfn0ZbA4r4CgxMmZ T1ggdilJ/Nw4ixEirixx4epsRoi4hMSs6RdYIWxeiRntT6Hq5SSmfV0Ddae0xPlZGxhhnln8 /TFUnF/i2O0dTBC2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Kj7CwkqVlI2mch aUdWs4CRZRWjaGpBckFxUnqFiV5xYm5xaV66XnJ+7iZGcCJ6tmQHY8MF60OMAhyMSjy8H4os QoVYE8uKK3MPMUpwMCuJ8ApNBQrxpiRWVqUW5ccXleakFh9iNAVG2kRmKdHkfGCSzCuJNzQ2 MDY0tDQ3MDU0slAS5/1/LjdESCA9sSQ1OzW1ILUIpo+Jg1OqgXHntwSnnluzLgWuj1S5/rSj ZFYYR7eMJLvS1eg3ameWNj55qJ52zKYnJIRrzf6XG/8fPBafvHP5fKsc/gBVkxlbLhxas/MP 27yru+82z3up9FexMtf6r9LZD2bbPASX9ar7SXnG6rIG1mwsX8tfeXKFf+T7CH8Pt7Zgw6/2 //VZ7qh/Ohid76fEUpyRaKjFXFScCAAkhW58WgMAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t3N6tWdR025438 Content-Length: 1438 Lines: 39 current_obj is declared as a thread-local storage. This prevent to detect locking problem between multiple threads because each thread has it's own current_obj. liblockdep can only detect locking problem in a single thread. However, pthread_mutex_xxx, pthread_rwlock_xxx functions are mainly used for synchro nization of data between multiple threads. This patch changes current_obj to non thread-local storage. and current_obj.pid is getting from getpid system call. Signed-off-by: Eunbong Song --- tools/lib/lockdep/common.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/lockdep/common.c b/tools/lib/lockdep/common.c index 8ef602f..6b9a6eb 100644 --- a/tools/lib/lockdep/common.c +++ b/tools/lib/lockdep/common.c @@ -5,7 +5,7 @@ #include #include -static __thread struct task_struct current_obj; +static struct task_struct current_obj; /* lockdep wants these */ bool debug_locks = true; @@ -26,7 +26,7 @@ struct task_struct *__curr(void) if (current_obj.pid == 0) { /* Makes lockdep output pretty */ prctl(PR_GET_NAME, current_obj.comm); - current_obj.pid = syscall(__NR_gettid); + current_obj.pid = syscall(__NR_getpid); } return ¤t_obj; -- 1.7.0.1 ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?