lkml.org 
[lkml]   [2007]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] Smackv10: Smack rules grammar + their stateful parser
    On 11/5/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:
    >
    >
    > On Mon, 5 Nov 2007, Ahmed S. Darwish wrote:
    >
    > > On Sun, Nov 04, 2007 at 12:28:48PM +0000, Pavel Machek wrote:
    > > >
    > > > Can we avoid string parsers in the kernel?
    > > >
    > >
    > > Ok, Could someone suggest a better idea please ?.
    >
    > I personally think string parsers are *much* better than the alternatives
    > (which basically boil down to nasty binary interfaces)
    >
    > > I thought about packing the rules in a structure and sending
    > > it over an ioctl() command. Is this applicable ?
    >
    > That's *MUCH* worse.
    >
    > Strings are nice. They aren't that complex, and as long as it's not a
    > performance-critical area, there are basically no downsides.
    >
    > Binary structures and ioctl's are *much* worse. They are totally
    > undebuggable with generic tools (think "echo" or "strace"), and they are a
    > total nightmare to parse across architectures and pointer sizes.
    >
    > So the rule should be: always use strings if at all possible and relevant.
    > If the data is fundamentally binary, it shouldn't be re-coded to ascii (no
    > real advantage), but if the data is "stringish", and there aren't big
    > performance issues, then keep it as strings.
    >

    Thanks a lot for such a kind advice. I'll keep that in my mind.

    Regards,

    --
    Ahmed S. Darwish
    Homepage: http://darwish.07.googlepages.com
    Blog: http://darwish-07.blogspot.com
    -
    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/

    \
     
     \ /
      Last update: 2007-11-06 00:41    [W:0.024 / U:33.172 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site