Ignore:
Timestamp:
Feb 12, 2013, 6:38:23 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
787ec4ed0bff77b2fd30601d7e99562b7f71fb7a
Parents:
643877cb2b7ba9e8b5c640ed05630fa816f821a0
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-02-12 18:38:23+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-02-13 17:13:27+01:00
Message:
Optional starting of Google Profiler

NOTE: also needs to link with -lprofiler (google tools)

NOTE: with the use of schreyer.lib: use ProfilerStart(file_name)/ProfilerStop()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • dyn_modules/syzextra/mod_main.cc

    r643877c rf63b13  
    3131#include "DebugPrint.h"
    3232#include "myNF.h"
     33
     34#ifdef HAVE_GOOGLE_PROFILER
     35#include <google/profiler.h>
     36#endif // HAVE_GOOGLE_PROFILER 
     37
     38
     39#include <stdio.h>
     40#include <stdlib.h>
     41#include <string.h>
     42
    3343
    3444extern void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r);
     
    158168}
    159169
    160 BOOLEAN noop(leftv __res, leftv /*__v*/)
     170static BOOLEAN noop(leftv __res, leftv /*__v*/)
    161171{
    162172  NoReturn(__res);
     
    164174}
    165175
     176static BOOLEAN _ProfilerStart(leftv __res, leftv h)
     177{
     178  NoReturn(__res);
     179#ifdef HAVE_GOOGLE_PROFILER
     180  if( h!= NULL && h->Typ() == STRING_CMD )
     181  {
     182    const char* name = (char*)(h->Data());
     183    assume( name != NULL );   
     184    ProfilerStart(name);
     185  } else
     186    WerrorS("ProfilerStart requires a string [name] argument");
     187#else
     188  WarnS("Sorry no google profiler support (undefined HAVE_GOOGLE_PROFILER)...");
     189//  return TRUE; // ?
     190#endif // #ifdef HAVE_GOOGLE_PROFILER
     191  return FALSE;
     192  (void)h;
     193}
     194static BOOLEAN _ProfilerStop(leftv __res, leftv /*__v*/)
     195{
     196  NoReturn(__res);
     197#ifdef HAVE_GOOGLE_PROFILER
     198  ProfilerStop();
     199#else
     200  WarnS("Sorry no google profiler support (undefined HAVE_GOOGLE_PROFILER)...");
     201//  return TRUE; // ?
     202#endif // #ifdef HAVE_GOOGLE_PROFILER
     203  return FALSE;
     204}
    166205
    167206static inline number jjLONG2N(long d)
     
    9761015  ADD(psModulFunctions, currPack->libname, "Tail", FALSE, Tail);
    9771016
    978 
    9791017  ADD(psModulFunctions, currPack->libname, "ISUpdateComponents", FALSE, ISUpdateComponents);
    9801018  ADD(psModulFunctions, currPack->libname, "SetInducedReferrence", FALSE, SetInducedReferrence);
     
    9831021  ADD(psModulFunctions, currPack->libname, "MakeInducedSchreyerOrdering", FALSE, MakeInducedSchreyerOrdering);
    9841022  ADD(psModulFunctions, currPack->libname, "MakeSyzCompOrdering", FALSE, MakeSyzCompOrdering);
     1023
     1024  ADD(psModulFunctions, currPack->libname, "ProfilerStart", FALSE, _ProfilerStart); ADD(psModulFunctions, currPack->libname, "ProfilerStop",  FALSE, _ProfilerStop );
    9851025 
    9861026  ADD(psModulFunctions, currPack->libname, "noop", FALSE, noop);
    987  
    9881027  ADD(psModulFunctions, currPack->libname, "idPrepare", FALSE, idPrepare);
    9891028  ADD(psModulFunctions, currPack->libname, "reduce_syz", FALSE, reduce_syz);
Note: See TracChangeset for help on using the changeset viewer.