From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752349AbbIOSkR (ORCPT ); Tue, 15 Sep 2015 14:40:17 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:36550 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752348AbbIOSkN (ORCPT ); Tue, 15 Sep 2015 14:40:13 -0400 Message-ID: <55f8660b.84bd440a.620d1.ffffe1cb@mx.google.com> X-Google-Original-Message-ID: Mime-Version: 1.0 (MHng) Date: Tue, 15 Sep 2015 11:40:11 -0700 (PDT) X-Google-Original-Date: Tue, 15 Sep 2015 11:40:09 PDT (-0700) From: Palmer Dabbelt To: peterz@infradead.org CC: arnd@arndb.de CC: dhowells@redhat.com CC: viro@zeniv.linux.org.uk CC: ast@plumgrid.com CC: aishchuk@linux.vnet.ibm.com CC: aarcange@redhat.com CC: akpm@linux-foundation.org CC: luto@kernel.org CC: acme@kernel.org CC: bhe@redhat.com CC: 3chas3@gmail.com CC: chris@zankel.net CC: dave@sr71.net CC: dyoung@redhat.com CC: drysdale@google.com CC: davem@davemloft.net CC: ebiederm@xmission.com CC: geoff@infradead.org CC: gregkh@linuxfoundation.org CC: hpa@zytor.com CC: mingo@kernel.org CC: iulia.manda21@gmail.com CC: plagnioj@jcrosoft.com CC: jikos@kernel.org CC: josh@joshtriplett.org CC: kexec@lists.infradead.org CC: linux-api@vger.kernel.org CC: linux-arch@vger.kernel.org CC: linux-fsdevel@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: linux-xtensa@linux-xtensa.org CC: mathieu.desnoyers@efficios.com CC: jcmvbkbc@gmail.com CC: paulmck@linux.vnet.ibm.com CC: tglx@linutronix.de CC: tomi.valkeinen@ti.com CC: vgoyal@redhat.com CC: x86@kernel.org CC: fweisbec@gmail.com Subject: Re: [PATCH 09/13] Move bp_type_idx to kernel/event/hw_breakpoint.c In-Reply-To: <20150915080607.GW16853@twins.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Sep 2015 01:06:07 PDT (-0700), peterz@infradead.org wrote: > On Mon, Sep 14, 2015 at 03:50:43PM -0700, Palmer Dabbelt wrote: >> This has a "#ifdef CONFIG_*" that used to be exposed to userspace. >> >> The names in here are so generic that I don't think it's a good idea >> to expose them to userspace (or even the rest of the kernel). Since >> there's only one kernel user, it's been moved to that file. >> >> Signed-off-by: Palmer Dabbelt >> Reviewed-by: Andrew Waterman >> Reviewed-by: Albert Ou >> --- >> include/uapi/linux/hw_breakpoint.h | 10 ---------- >> kernel/events/hw_breakpoint.c | 10 ++++++++++ >> 2 files changed, 10 insertions(+), 10 deletions(-) >> >> diff --git a/include/uapi/linux/hw_breakpoint.h b/include/uapi/linux/hw_breakpoint.h >> index b04000a2296a..7a6a5a7f9511 100644 >> --- a/include/uapi/linux/hw_breakpoint.h >> +++ b/include/uapi/linux/hw_breakpoint.h >> @@ -17,14 +17,4 @@ enum { >> HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, >> }; >> >> -enum bp_type_idx { >> - TYPE_INST = 0, >> -#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS >> - TYPE_DATA = 0, >> -#else >> - TYPE_DATA = 1, >> -#endif >> - TYPE_MAX >> -}; > > This is rather unfortunate; you are correct that the naming is too > generic (and I tend to agree), but I think these values are required by > userspace to fill out: > > perf_event_attr::bp_type > > So removing them will break things. > > Frederic? perf_event_open(2) says bp_type (since Linux 2.6.33) This chooses the breakpoint type. It is one of: HW_BREAKPOINT_EMPTY No breakpoint. HW_BREAKPOINT_R Count when we read the memory location. HW_BREAKPOINT_W Count when we write the memory location. HW_BREAKPOINT_RW Count when we read or write the memory location. HW_BREAKPOINT_X Count when we execute code at the memory location. The values can be combined via a bitwise or, but the combination of HW_BREAKPOINT_R or HW_BREAKPOINT_W with HW_BREAKPOINT_X is not allowed. so I think removing this enum from userspace is OK. Did I miss something?