Exemple #1
0
int main( int argc, char **argv ) {
    int defs_ok = _LANG_DEFS_OK();

    if( argc < 5 || argc > 10 ) {
        fatal( "usage: msgencod [-w] [-i] [-ip] [-q] [-p] <gml> <msgc> <msgh> <levh>" );
    }
    if( ! defs_ok ) {
        fatal( "language index mismatch" );
    }
    processOptions( argv + 1 );
    readGML();
    if( flags.gen_gpick ) {
        writeMsgHGP();
        writeMsgCGP();
        writeLevHGP();
    }else{
        compressMsgs();
        writeMsgH();
        writeMsgC();
        writeLevH();
    }
    closeFiles();
    if( flags.international ) {
        dumpInternational();
    }
    if( ! flags.quiet ) {
        dumpStats();
    }
    if( warnings != 0 && flags.warnings_always_rebuild ) {
        forceRebuild();
    }
    return( errors ? EXIT_FAILURE : EXIT_SUCCESS );
}
STDMETHODIMP MachineDebuggerWrap::DumpStats(IN_BSTR aPattern)
{
    LogRelFlow(("{%p} %s:enter aPattern=%ls\n", this, "MachineDebugger::dumpStats", aPattern));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = dumpStats(BSTRInConverter(aPattern).str());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "MachineDebugger::dumpStats", hrc));
    return hrc;
}
SuperHashTable::~SuperHashTable()
{
    doKill();
#ifdef TRACE_HASH
    dumpStats();
#endif
}
Exemple #4
0
void ScEngine::disableProfiling() {
	if (!_isProfiling) {
		return;
	}

	dumpStats();
	_isProfiling = false;
}
Exemple #5
0
StringHost::~StringHost() {
  if(tracked_host) {
    localHost = true; /* Hack */
    ntop->getRedis()->addIpToDBDump(iface, NULL, keyname);
    dumpContacts(keyname, family_id);
  } 

  dumpStats(ntop->getPrefs()->get_aggregation_mode() == aggregations_enabled_with_bitmap_dump);
  free(keyname);
}
Exemple #6
0
void GenericHost::updateActivities() {
  time_t when = iface->getTimeLastPktRcvd();

  if(when != last_activity_update) {
    /* Set a bit every CONST_TREND_TIME_GRANULARITY seconds */
    when -= when % CONST_TREND_TIME_GRANULARITY;
    if(when > activityStats.get_wrap_time()) dumpStats(false);
    activityStats.set(when);
    last_activity_update = when;
  }
}
Exemple #7
0
    virtual void invoke(logrec_t& r)
    {
        // Dump stats on each tick log record
        if (r.type() == logrec_t::t_tick_sec || r.type() == logrec_t::t_tick_msec) {
            dumpStats(r.lsn());
            return;
        }
        // Code copied from chkpt_t::scan_log
        if (r.is_redo()) {
            // Ignore metadata pages
            if (r.pid() % alloc_cache_t::extent_size == 0 ||
                    r.pid() == stnode_page::stpid)
            {
                return;
            }

            lsn_t lsn = r.lsn();
            w_assert0(r.is_redo());
            chkpt.mark_page_dirty(r.pid(), lsn, lsn);

            if (r.is_multi_page()) {
                w_assert0(r.pid2() != 0);
                chkpt.mark_page_dirty(r.pid2(), lsn, lsn);
            }
            updates++;
        }
        else if (r.type() == logrec_t::t_page_write) {
            char* pos = r.data();

            PageID pid = *((PageID*) pos);
            pos += sizeof(PageID);

            lsn_t clean_lsn = *((lsn_t*) pos);
            pos += sizeof(lsn_t);

            uint32_t count = *((uint32_t*) pos);
            PageID end = pid + count;

            while (pid < end) {
                chkpt.mark_page_clean(pid, clean_lsn);
                pid++;
            }

            page_writes += count;
        }
        else if (r.type() == logrec_t::t_xct_end) {
            commits++;
        }
    }
Exemple #8
0
/* Advance the simulation by one time step. Render and/or dump statistics 
 * if neccesary. Return false if the user wants to quit. */
static bool stepSimulation(Timer *renderTimer) {
	static int  stepsSinceVerbose = 0;

	stepWorld();

	if (config.verbose > 0) {
		stepsSinceVerbose++;
		if (stepsSinceVerbose > config.verbose) {
			stepsSinceVerbose = 0;
			dumpStats();
		}
	}

	if (config.render && tickTimer(renderTimer))
			return stepGraphics();

	return true;
}
Exemple #9
0
void SedaStatsStage::manageEvent(StageEvent *event)
{
#if SEDASTATS_MANAGE

    CollectStatsRequest*           collectStatsReq;
    ClearStatsRequest*             clearStatsReq;
    EnableStatsCollectionRequest*  enableStatsReq;
    DisableStatsCollectionRequest* disableStatsReq;

    //Handle the other commEvents sent
    MgmtEvent* mev = dynamic_cast<MgmtEvent*>(event);
    ASSERT(mev, "Expected management event.");

    Request* request = mev->getRequest();
    if (NULL != (collectStatsReq = 
                dynamic_cast<CollectStatsRequest*> (request))){
        LOG_ERROR( "%s", "CollectStatsReq received");
        dumpStats(event);
        return;
    }
    else if (NULL != (clearStatsReq =
                dynamic_cast<ClearStatsRequest*>(request))){
        LOG_ERROR( "%s", "clear stats received");
        clearStats(event);
    }
    else if (NULL != (enableStatsReq =
                dynamic_cast<EnableStatsCollectionRequest*>(request))){
        LOG_ERROR( "%s", "Enable stats received");
        enableCategory(event);
    }
    else if (NULL != (disableStatsReq =
                dynamic_cast<DisableStatsCollectionRequest*>(request))){
        LOG_ERROR( "%s", "Disable stats received");
        disableCategory(event);
    }
    else {
        TRCERR(CtgLog|CtgTrace, "%s", "Unknown event type in handleEvent");
    }
#endif
}
Exemple #10
0
StringHost::~StringHost() {
  flushContacts();

  dumpStats(ntop->getPrefs()->get_aggregation_mode() == aggregations_enabled_with_bitmap_dump);
  free(keyname);
}