~ubuntu-branches/ubuntu/quantal/virtualbox/quantal

« back to all changes in this revision

Viewing changes to src/VBox/Main/src-server/Performance.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2012-04-05 12:41:55 UTC
  • mfrom: (3.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120405124155-i7b39tv5ddwhubbe
Tags: 4.1.12-dfsg-2
* Upstream has replaced the 4.1.12 tarball with a new one that fixes a
  crash when creating host only interfaces. (Closes: #667460)
  - Add 36-tarball-respin.patch which contains the diff between the old
    and the new tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
 
163
163
void CGRQEnable::debugPrint(void *aObject, const char *aFunction, const char *aText)
164
164
{
 
165
    NOREF(aObject);
 
166
    NOREF(aFunction);
 
167
    NOREF(aText);
165
168
    LogAleksey(("{%p} " LOG_FN_FMT ": CGRQEnable(mask=0x%x) %s\n",
166
169
                aObject, aFunction, mMask, aText));
167
170
}
174
177
 
175
178
void CGRQDisable::debugPrint(void *aObject, const char *aFunction, const char *aText)
176
179
{
 
180
    NOREF(aObject);
 
181
    NOREF(aFunction);
 
182
    NOREF(aText);
177
183
    LogAleksey(("{%p} " LOG_FN_FMT ": CGRQDisable(mask=0x%x) %s\n",
178
184
                aObject, aFunction, mMask, aText));
179
185
}
185
191
 
186
192
void CGRQAbort::debugPrint(void *aObject, const char *aFunction, const char *aText)
187
193
{
 
194
    NOREF(aObject);
 
195
    NOREF(aFunction);
 
196
    NOREF(aText);
188
197
    LogAleksey(("{%p} " LOG_FN_FMT ": CGRQAbort %s\n",
189
198
                aObject, aFunction, aText));
190
199
}
362
371
    int rc = RTThreadCreate(&mThread, CollectorGuestManager::requestProcessingThread,
363
372
                            this, 0, RTTHREADTYPE_MAIN_WORKER, RTTHREADFLAGS_WAITABLE,
364
373
                            "CGMgr");
 
374
    NOREF(rc);
365
375
    LogAleksey(("{%p} " LOG_FN_FMT ": RTThreadCreate returned %u (mThread=%p)\n",
366
376
                this, __PRETTY_FUNCTION__, rc));
367
377
}
479
489
     * It is very unlikely that we will get high frequency calls to configure
480
490
     * guest metrics collection, so we rely on this fact to detect blocked
481
491
     * guests. If the guest has not finished processing the previous request
482
 
     * we consider it blocked.
 
492
     * after half a second we consider it blocked.
483
493
     */
484
494
    if (aRequest->getGuest() && aRequest->getGuest() == mGuestBeingCalled)
485
495
    {
486
 
        /* Request execution got stalled for this guest -- report an error */
487
 
        return E_FAIL;
 
496
        /* 
 
497
         * Before we can declare a guest blocked we need to wait for a while
 
498
         * and then check again as it may never had a chance to process
 
499
         * the previous request. Half a second is an eternity for processes
 
500
         * and is barely noticable by humans.
 
501
         */
 
502
        LogAleksey(("{%p} " LOG_FN_FMT ": Suspecting %s is stalled. Waiting for .5 sec...\n",
 
503
                    this, __PRETTY_FUNCTION__,
 
504
                    aRequest->getGuest()->getVMName().c_str()));
 
505
        RTThreadSleep(500 /* ms */);
 
506
        if (aRequest->getGuest() == mGuestBeingCalled) {
 
507
            LogAleksey(("{%p} " LOG_FN_FMT ": Request processing stalled for %s\n",
 
508
                        this, __PRETTY_FUNCTION__,
 
509
                        aRequest->getGuest()->getVMName().c_str()));
 
510
            /* Request execution got stalled for this guest -- report an error */
 
511
            return E_FAIL;
 
512
        }
488
513
    }
489
514
    mQueue.push(aRequest);
490
515
    return S_OK;
498
523
 
499
524
    HRESULT rc = S_OK;
500
525
 
501
 
    LogAleksey(("{%p} " LOG_FN_FMT ": Starting request processing loop...p\n",
 
526
    LogAleksey(("{%p} " LOG_FN_FMT ": Starting request processing loop...\n",
502
527
                mgr, __PRETTY_FUNCTION__));
503
528
    while ((pReq = mgr->mQueue.pop()) != NULL)
504
529
    {