| Previous | Next |
| ERROR_INSTRUCTION_MISALIGNMENT | ERROR_PROFILING_NOT_STOPPED |
ERROR_PROFILING_NOT_STARTED
What ERROR_PROFILING_NOT_STARTED means
This status is returned when code attempts to stop, query, or otherwise operate on a profiling session that was never started, has already ended, or was created in a different scope. It is primarily a sequencing error rather than evidence that the profiler itself is damaged.
Where it commonly appears
- Performance-analysis tools that start and stop kernel or process profiling sessions
- Diagnostic agents that expose profiling through a service or RPC boundary
- Cleanup paths that run after partial initialization and assume a session exists
Likely causes
- The start operation failed but the failure was ignored
- A stop or query call was issued twice
- The session handle belongs to another process, target, or boot session
- Concurrent cleanup raced with normal shutdown
Troubleshooting checklist
- Log the result of the original start call and retain the first failure
- Record the session identifier, target process, caller PID, and start/stop timestamps
- Check whether cleanup can run from more than one thread
- Verify that a restart or service reconnect did not discard the in-memory session state
Guidance for developers
Model profiling as an explicit state machine: not started, active, stopping, and stopped. Transition to active only after the start call succeeds. Make cleanup idempotent, and do not overwrite the original initialization failure with this secondary status.
Guidance for administrators
If this appears in a third-party profiler, restart the profiling session rather than repeatedly issuing stop or query commands. Collect the profiler log and the first error before restarting the service.
Example
A monitoring service allocates its bookkeeping object, fails to enable profiling because access is denied, and later executes a generic shutdown routine. The shutdown routine calls the stop API and receives this code. The actionable failure is the earlier access-denied result, not the shutdown status.
Related conditions
Do not confuse this with ERROR_PROFILING_NOT_STOPPED, which means an active profiling operation could not be stopped, or ERROR_PROFILING_AT_LIMIT, which means a resource limit prevented another profile from starting.
References
Looking for a different code? Search another status or error code.