Skip to content

Commit

Permalink
Handling RESULT_CODE_FAILURE_NO_CONTEXT_INFO_AVAILABLE and simplifyin…
Browse files Browse the repository at this point in the history
…g noAdmin logic

Handling RESULT_CODE_FAILURE_NO_CONTEXT_INFO_AVAILABLE and simplifying noAdmin logic
  • Loading branch information
laurenprinn committed Jun 20, 2022
1 parent 77ae3c6 commit 37144f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/Commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void PrintError(RESULT_CODE failureCode)
case RESULT_CODE_FAILURE_INSUFFICIENT_PRIVILEGES:
std::wcout << "This operation requires administrator privileges.";
break;

case RESULT_CODE_FAILURE_DROPPED_EVENTS:
std::wcout << "Events were dropped during the trace. Please try recollecting the trace.";
break;
Expand All @@ -146,7 +146,10 @@ void PrintError(RESULT_CODE failureCode)
"does not support the version of the operating system that the trace was collected on. "
"Please try updating vcperf to the latest version.";
break;

case RESULT_CODE_FAILURE_NO_CONTEXT_INFO_AVAILABLE:
std::wcout << "You are using a version of Build Insights that does not support the `/noadmin` option. "
"Please try updating your Build Insights version to at least 1.3.0.";
break;
case RESULT_CODE_FAILURE_START_SYSTEM_TRACE:
case RESULT_CODE_FAILURE_START_MSVC_TRACE:
std::wcout << "A trace that is currently being collected on your system is preventing vcperf "
Expand Down
3 changes: 1 addition & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,10 @@ int wmain(int argc, wchar_t* argv[])
return E_FAIL;
}
noAdminSpecified = true;
noCpuSamplingSpecified = true;
}
else if (subCommand == StartSubCommand::NO_CPU_SAMPLING)
{
if (noCpuSamplingSpecified && !noAdminSpecified)
if (noCpuSamplingSpecified)
{
std::wcout << L"ERROR: you can only specify /nocpusampling once." << std::endl;
std::wcout << L"vcperf.exe /start [/noadmin] [/nocpusampling] [/level1 | /level2 | /level3] sessionName" << std::endl;
Expand Down

0 comments on commit 37144f8

Please sign in to comment.