[rrd-developers] Re: calling rrd_create directly in librrd.so

paulw at oninit.com paulw at oninit.com
Fri Jul 20 14:17:59 MEST 2001



I just build the command line within the C code that the standard
rrdtool would expect and then just system(cmdline);  It works fine but 
I was expecting that linking the rrdtool C code in would make it a lot 
quicker as a system call is expensive.  But I've found that it's
10% slower - which I can't figure out why - yet:-))

I use an environment variable to tell it to use a system call or
rrd_xxxx directly so it's the same code in both instances.

"Edwyn Stapel (ELN)" wrote:
> 
> hi paul,
> you talked about a system call. i'm having other problems with the rrd.lib.
> How would such a system call be implemented?
> 
> regards,
> 
> Edwyn Stapel
> 
> -----Original Message-----
> From: paulw at oninit.com [mailto:paulw at oninit.com]
> Sent: Friday, July 20, 2001 11:35 AM
> To: Ashok Mandala
> Cc: rrd-developers at list.ee.ethz.ch
> Subject: [rrd-developers] Re: calling rrd_create directly in librrd.so
> 
> Does this happen on the first rrd call or subsequent ones?  If it's
> subsquent you need to be resetting optind and opterr.  I've just been
> through this loop.  The worrying thing is I've found it faster (10%)
> to build a system call and run it than it was to link in the libraries.
> 
> Ashok Mandala wrote:
> >
> > Hi,
> >
> > I am trying to use the "C" API  for the rrd functionality to
> > create/update rrd files. I have created the proper argument list that
> > rrd_create expects, but I get a segmentation fault from rrd_create when
> > I try to use it. I have stepped through the code using gdb and have
> > followed it to the point in rrd_create.c where it calls getopt_long() -
> > there it issues a segmentation fault when I try to step into it. I saw
> > some code for getopt_long() definition in getopt1.c included with
> > rrdtool - so this call should have gone to that getopt_long() and the
> > source should have opened up. Is the call binding to the libc
> > getopt_long() ? Has anyone faced this same problem before ?
> >
> > Thanks.
> > Ashok.
> >
> > --
> > Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
> > Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
> > Archive     http://www.ee.ethz.ch/~slist/rrd-developers
> > WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
> 
> --
> Paul Watson             #
> Oninit Ltd              # You are only young once
> Tel: +44 1436 672201    # but you can be immature
> Fax: +44 1436 678693    # for ever
> www.oninit.com          #
> 
> --
> Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
> Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
> Archive     http://www.ee.ethz.ch/~slist/rrd-developers
> WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

-- 
Paul Watson             #          
Oninit Ltd              # You are only young once
Tel: +44 1436 672201    # but you can be immature
Fax: +44 1436 678693    # for ever
www.oninit.com          #

--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list