From mboxrd@z Thu Jan 1 00:00:00 1970 From: ravi.bangoria@linux.ibm.com (Ravi Bangoria) Date: Tue, 21 Aug 2018 10:12:13 +0530 Subject: [PATCH v9 0/4] Uprobes: Support SDT markers having reference count (semaphore) In-Reply-To: References: <20180820044250.11659-1-ravi.bangoria@linux.ibm.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Song, > root at virt-test:~# ~/a.out > 11 > semaphore 0 > semaphore 0 > semaphore 2 <<< when the uprobe is enabled Yes, this happens when multiple vmas points to the same file portion. Can you check /proc/`pgrep a.out`/maps. Logic is simple. If we are going to patch an instruction, increment the reference counter. If we are going to unpatch an instruction, decrement the reference counter. In this case, we patched instruction twice and thus incremented reference counter twice as well. Ravi