Re: [PATCH 05/05] Linux Kernel Markers, non optimized architectures
From: Mathieu Desnoyers
Date: Wed Feb 21 2007 - 15:51:05 EST
* Karim Yaghmour (karim.yaghmour@xxxxxxxxxxxx) wrote:
> ----- KRYPTIVA PACKAGED MESSAGE -----
> PACKAGING TYPE: SIGNED
> Hello Mathieu,
> Mathieu Desnoyers wrote:
> > Yes, that was indeed the first way I implemented it, as a "disable"
> option. One of the main thing we have to figure out before I modify this is
> if we want to have the generic version of markers available in a "forced"
> manner at the marker site with the GEN_MARK macro instead of the MARK macro
> (this is the actual implementation). It has proven to be useful to
> instrument lockdep.c irq
> > enable/disable tracing functions. The reason why is because they are
> called just before the trap handler returns and I need it to do XMC on x86
> and x86_64. It would therefore cause a recursive trap.
> > I think it makes sense to have this kind of support for
> hard-to-instrument sites within the marker infrastructure, but the cost is
> to have two marker flavors : MARK and GEN_MARK (but really GEN_MARK is only
> intended for a few sites).
> I must admit that I'm unsure about the use of different marker macros.
> How about bitwise flags that could be coded as part of the marker
> at the marker site? Something like "MARKER_TYPE_FORCED". This would
> still allow some form of toplevel control at the macro definition.
> Otherwise there's some digging to be done on a per-marker
> basis ...
The problem with your proposal, I guess, is that people will have to
add a supplementary parameter to the macro.
It is not uncommon to have two slightly versions of macros/functions in
the kernel (preempt_enable()/preempt_enable_no_resched(), or macros
starting with underscores). Normally, the underscore states that the
macro does not do the proper locking itself (this is not our case).
Therefore, I would suggest using a name that suggests against what the
macro is protected. For instance, a marker pointing to the generic
version is only needed to protect against the debug trap handler and
should only be used on x86 and x86_64.
So, something like MARK_NO_TRAP() would be appropriate : it would be an
optimized version for every architecture except x86 and x86_64. The
meaning of this macro is : "This is a marker that will never generate a
trap because of its activation" (just as a precision : it doesn't say
anything about the probe connected to the marker). It also acts as a
strong suggestion about what *should not* be done within the probe.
> ----- KRYPTIVA SIGNED MESSAGE -----
> This email claims to have been packaged by Kryptiva.
> To process this email and authenticate its origin, get
> the free plugin from:
> ----- KRYPTIVA SIGNATURE START -----
> ----- KRYPTIVA SIGNATURE END -----
Computer Engineering Ph.D. Candidate, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/