_user_system_profiler_start(): Check the sampling related parameters only when
sampling is requested at all. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30294 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -833,14 +833,19 @@ _user_system_profiler_start(struct system_profiler_parameters* userParameters)
|
|||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if (areaInfo.team != team || parameters.stack_depth < 1)
|
if (areaInfo.team != team)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
if (parameters.interval < B_DEBUG_MIN_PROFILE_INTERVAL)
|
if ((parameters.flags & B_SYSTEM_PROFILER_SAMPLING_EVENTS) != 0) {
|
||||||
parameters.interval = B_DEBUG_MIN_PROFILE_INTERVAL;
|
if (parameters.stack_depth < 1)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
if (parameters.stack_depth > B_DEBUG_STACK_TRACE_DEPTH)
|
if (parameters.interval < B_DEBUG_MIN_PROFILE_INTERVAL)
|
||||||
parameters.stack_depth = B_DEBUG_STACK_TRACE_DEPTH;
|
parameters.interval = B_DEBUG_MIN_PROFILE_INTERVAL;
|
||||||
|
|
||||||
|
if (parameters.stack_depth > B_DEBUG_STACK_TRACE_DEPTH)
|
||||||
|
parameters.stack_depth = B_DEBUG_STACK_TRACE_DEPTH;
|
||||||
|
}
|
||||||
|
|
||||||
// quick check to see whether we do already have a profiler installed
|
// quick check to see whether we do already have a profiler installed
|
||||||
InterruptsSpinLocker locker(sProfilerLock);
|
InterruptsSpinLocker locker(sProfilerLock);
|
||||||
|
|||||||
Reference in New Issue
Block a user