All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Antill <jantill@redhat.com>
To: SE Linux <selinux@tycho.nsa.gov>
Subject: Re: Real simple cache that removes most of the lookups in mcstrans
Date: Wed, 17 May 2006 12:22:44 -0400	[thread overview]
Message-ID: <1147882964.3469.143.camel@code.and.org> (raw)
In-Reply-To: <446AFED3.9010800@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1505 bytes --]

On Wed, 2006-05-17 at 06:45 -0400, Daniel J Walsh wrote:
> Basically check if the previous lookup was the same context, if yes 
> return the same translation.   Otherwise do the lookup.

 Are we sure one is enough, lsof -Z does both s0 and s0-s0:c0.c255 and
they are basically mixed (I appreciate it is much easier to code a cache
of 1 than >1 though).

 Also:

+       } else {
+               free(prev_t2r_trans);
+               free(prev_t2r_raw);
+               if (trans_to_raw_context(trans, rawp))
+                       *rawp = strdup(trans);
+               prev_t2r_trans=strdup(trans);
+               prev_t2r_raw=strdup(*rawp);

...this is bad when trans_to_raw_context, the first strdup() fails or
the last strdup() fails.

> Also included Russells patch for avcstat.

-                       printf("%10u %10u %10u %10u %10u %10u\n",
+                       printf("%10Lu %10Lu %10Lu %10Lu %10Lu %10Lu\n",

 It's somewhat minor, but that should be %llu %Lu is a somewhat common
extension. From man printf:

       ll     (ell-ell).  A following integer conversion corresponds to a long
              long int or unsigned long long int argument, or  a  following  n
              conversion corresponds to a pointer to a long long int argument.

       L      A following a, A, e, E, f, F, g, or G conversion corresponds  to
              a long double argument.  (C99 allows %LF, but SUSv2 does not.)

-- 
James Antill
<james.antill@redhat.com>


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

      parent reply	other threads:[~2006-05-17 16:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-17 10:45 Real simple cache that removes most of the lookups in mcstrans Daniel J Walsh
2006-05-17 12:26 ` Steve Grubb
2006-05-17 13:52 ` Joshua Brindle
2006-05-17 15:03   ` Daniel J Walsh
2006-05-17 15:15     ` Joshua Brindle
2006-05-17 16:21       ` Daniel J Walsh
2006-05-17 17:09         ` Joshua Brindle
2006-05-17 17:30           ` Steve Grubb
2006-05-17 17:32             ` Joshua Brindle
2006-05-19 13:32       ` Russell Coker
2006-05-19 13:51         ` Joshua Brindle
2006-05-19 14:07           ` Stephen Smalley
2006-05-19 14:40             ` Russell Coker
2006-05-20 21:47             ` Joshua Brindle
2006-05-21  3:31               ` Russell Coker
2006-05-22 18:04               ` Stephen Smalley
     [not found] ` <1147879972.3469.139.camel@code.and.org>
2006-05-17 16:19   ` Daniel J Walsh
2006-05-17 16:56     ` James Antill
2006-05-17 17:06       ` Stephen Smalley
2006-05-18 16:21         ` Daniel J Walsh
2006-05-17 18:22   ` Daniel J Walsh
2006-05-22 20:45     ` Stephen Smalley
2006-05-17 18:35   ` Resent with correct patch Daniel J Walsh
2006-05-17 18:44     ` Stephen Smalley
2006-05-17 16:22 ` James Antill [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1147882964.3469.143.camel@code.and.org \
    --to=jantill@redhat.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.