Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754535AbbGFLtZ (ORCPT ); Mon, 6 Jul 2015 07:49:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48809 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753816AbbGFLtY (ORCPT ); Mon, 6 Jul 2015 07:49:24 -0400 Date: Mon, 6 Jul 2015 17:19:20 +0530 From: Pratyush Anand To: Masami Hiramatsu Cc: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, wcohen@redhat.com, dave.long@linaro.org, steve.capper@linaro.org Subject: Re: [PATCH 1/2] arm64: Blacklist non-kprobe-able symbols Message-ID: <20150706114920.GB17305@dhcppc13.redhat.com> References: <9994841a0b0a8194a6dcc1b6af148ba358488c62.1436158027.git.panand@redhat.com> <559A6257.60608@hitachi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <559A6257.60608@hitachi.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2017 Lines: 54 On 06/07/2015:08:11:19 PM, Masami Hiramatsu wrote: > On 2015/07/06 14:03, Pratyush Anand wrote: > > Add all function symbols which are called from do_debug_exception under > > NOKPROBE_SYMBOL, as they can not kprobed. > > Could you tell me how you checked that? from the code? Well.. I found out that some of the symbol like single_step_handler does not allow kprobing, and then it seemed logical to me that we should not allow kprobing of any symbols which are called in the path of do_debug_exception. So, manually :( I reviewed the code and put NOKPROBE_SYMBOL across all those. However, now I am doing some more tests and as I said in previous reply, there are still few symbols like (_mcount) which is creating problem with following simple test and I need to look into that. In case of _mcount, I do not see any print and its complete freeze. #!/bin/sh grep ' [tT] ' /proc/kallsyms | fgrep -v '[' | awk '{print $3}' > syms.list count=0 for i in `cat syms.list`; do if [ $count == 0 ] then echo 0 > /sys/kernel/debug/tracing/events/enable echo > /sys/kernel/debug/tracing/kprobe_events cat /sys/kernel/debug/tracing/kprobe_events fi count=`expr $count + 1`; echo "p $i" >> /sys/kernel/debug/tracing/kprobe_events ; echo $i $count; if [ $count == 100 ] then cat /sys/kernel/debug/tracing/kprobe_events echo 1 > /sys/kernel/debug/tracing/events/enable sleep 1 cat /sys/kernel/debug/tracing/trace count=0 fi done I understand that above test does not make sure that kprobed function is called during test. Since at present this basic test is not running, so I am not doing anything to exercise more and more kernel paths. May be I will do that as second step..In fact at present, no idea how can be done that extensively. ~Pratyush -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/