コード例 #1
0
ファイル: rrd.c プロジェクト: andreaaraldo/mytstat
void
rrdtool_init ()
{
  int i;

  rrd_clear_error ();
  rrd.fatal = 1;
  rrdtool_parse_config ();
  rrd.time_update = 0;

  for (i = 0; i < MAX_RRD_ARGV; i++)
    rrd.argv[i] = (char *) malloc (512);

  /* we rather want to create this now...    */
  /* but we need to wait for the first entry */
  /* so this is deferred to update           */
  /*            rrdtool_create_all();        */
}
コード例 #2
0
ファイル: rrd.c プロジェクト: paivaspol/tstat
void
rrdtool_init ()
{
  int i;

#ifdef RRD_THREADED
  pipe(command_pipe);
  fcntl(command_pipe[1], F_SETPIPE_SZ, 1048576);
#endif
  
  rrd_clear_error ();
  rrd.fatal = 1;
  rrdtool_parse_config ();
  rrd.time_update = 0;

  for (i = 0; i < MAX_RRD_ARGV; i++)
    rrd.argv[i] = (char *) malloc (512);

#ifdef RRD_THREADED 
  /* Create files at beginning, no blocks later!!!          */
  //rrdtool_create_all();     

  /* Set current thread with high CPU and IO priority 
  struct sched_param sc_par;
  sc_par.sched_priority = 0;
  pthread_setschedparam(pthread_self(), SCHED_OTHER, &sc_par);
  setpriority(PRIO_PROCESS, 0, -20); */
  //syscall(SYS_ioprio_set,1, 0,  (2<< 13)| 0); 
  pthread_create (&write_thread, NULL, (void *) &call_rrd_update, (void *) NULL);
#else

  /* we rather want to create this now...    */
  /* but we need to wait for the first entry */
  /* so this is deferred to update           */
  /*            rrdtool_create_all();        */

#endif


}