public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: linux-audit@redhat.com
Subject: Re: Refactoring src/ausearch-report.c:output_interpreted_node()
Date: Wed, 01 Oct 2014 17:24:25 -0400	[thread overview]
Message-ID: <4321635.J1bcJ4DFLF@x2> (raw)
In-Reply-To: <1528037.iuGHCJfh4q@x2>

On Wednesday, October 01, 2014 05:19:39 PM Steve Grubb wrote:
> On Thursday, October 02, 2014 07:08:13 AM Burn Alting wrote:
> > On Wed, 2014-10-01 at 14:54 -0400, Steve Grubb wrote:
> > > > I am uncertain what effect of accepting this additional format would
> > > > have when adding rules to the running audit system - i.e.
> > > > audit_name_to_msg_type() is called by autrace/auditctl when parsing
> > > > rules (ie the msgtype field name).
> > > 
> > > I think ausearch-report.c might be the place that needs updating.
> > 
> > So, could we modify output_interpreted_node() to no longer re-parse the
> > 
> >    [node=<node>] type=<type> msg=audit(<epochsecs>.<msecs>:<serial>)
> > 
> > header and pass both the lnode and llist->e which has this data already
> > as the code
> > 
> >           if (num == -1) {
> >           
> >               // see if we are older and wiser now.
> >               bptr = strchr(str, '[');
> >               if (bptr && bptr < ptr) {
> >                   char *eptr;
> >                   bptr++;
> >                   eptr = strchr(bptr, ']');
> >                   if (eptr) {
> >                        *eptr = 0;
> >                        errno = 0;
> >                        num = strtoul(bptr, NULL, 10);
> >                        *eptr = ']';
> >                        if (errno)
> >                            num = -1;
> >                   }
> >                }
> >          }
> > 
> > which parses for
> > 
> >     type=.*[n].*
> > 
> > is no longer needed as we don't have that format any more?
> 
> That is a very loose check for UNKNOWN[####]. If you see a performance
> improvement by refactoring this function, please send a patch. The output
> needs to be identical to the old way.

Note that this section of code is on the "slow path". The value of interest 
extraction and matching is the performance critical area. Once an event is 
selected for output, the tty scrolling and buffering probably dominate the 
speed. So, I would take a patch to optimize this, but I don't expect it to 
make a big difference.

-Steve

  reply	other threads:[~2014-10-01 21:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29  2:41 Refactoring src/ausearch-report.c:output_interpreted_node() Burn Alting
2014-09-29 20:48 ` Burn Alting
2014-10-01 18:54 ` Steve Grubb
2014-10-01 21:08   ` Burn Alting
2014-10-01 21:19     ` Steve Grubb
2014-10-01 21:24       ` Steve Grubb [this message]
2014-10-01 21:54         ` Burn Alting
2014-10-01 21:52       ` Burn Alting
2014-10-01 22:28         ` Steve Grubb
2014-10-02  9:29           ` Burn Alting
2014-10-07  9:31             ` Burn Alting
2014-10-07 15:26               ` Steve Grubb

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=4321635.J1bcJ4DFLF@x2 \
    --to=sgrubb@redhat.com \
    --cc=linux-audit@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox