Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions rdkPlugins/Minidump/source/Minidump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ bool Minidump::postHalt()
#define FIREBOLT_STATE_TS "fireboltState_ts"
#define FIREBOLT_STATE_PREV "fireboltState_prev"
#define FIREBOLT_STATE_PREV_TS "fireboltState_prev_ts"
#define MINIDUMP_PREFIX "minidump_prefix"
#define MINIDUMP_FILENAME_LENGTH 44
Comment thread
Sonajeya31 marked this conversation as resolved.
#define MINIDUMP_FN_SEPERATOR "<#=#>"

Expand Down Expand Up @@ -243,15 +244,29 @@ std::string Minidump::getDestinationFile(int fd)
//remove prefix before and including "apps_" from containerId
containerId = containerId.substr(containerId.find("apps_") + 5);
}

/* Use minidump_prefix annotation (set to appId after OnStarted) as the filename prefix */
std::string filePrefix = containerId;
auto prefixIt = annotations.find(MINIDUMP_PREFIX);
if (prefixIt != annotations.end() && !prefixIt->second.empty())
{
filePrefix = prefixIt->second;
AI_LOG_INFO("Using minidump_prefix annotation '%s' for filename", filePrefix.c_str());
}
else
{
AI_LOG_INFO("minidump_prefix annotation not found, falling back to containerId '%s'", containerId.c_str());
}

Comment thread
Sonajeya31 marked this conversation as resolved.
if (it != annotations.end()) {
fileName = containerId + MINIDUMP_FN_SEPERATOR + it->second.c_str() + MINIDUMP_FN_SEPERATOR + timeString.str();
fileName = filePrefix + MINIDUMP_FN_SEPERATOR + it->second.c_str() + MINIDUMP_FN_SEPERATOR + timeString.str();
if (fileName.length() > MINIDUMP_FILENAME_LENGTH)
Comment thread
Sonajeya31 marked this conversation as resolved.
fileName.resize(MINIDUMP_FILENAME_LENGTH);
destFile = dir + "/" + fileName + ".dmp";
AI_LOG_INFO("Firebolt state: %s, minidump filename: %s", it->second.c_str(), destFile.c_str());
} else {
AI_LOG_INFO("Firebolt state not found or not valid at crash time");
fileName = containerId + MINIDUMP_FN_SEPERATOR + timeString.str();
fileName = filePrefix + MINIDUMP_FN_SEPERATOR + timeString.str();
if (fileName.length() > MINIDUMP_FILENAME_LENGTH)
fileName.resize(MINIDUMP_FILENAME_LENGTH);
destFile = dir + "/" + fileName + ".dmp";
Expand Down Expand Up @@ -281,3 +296,4 @@ std::vector<std::string> Minidump::getDependencies() const
return dependencies;
}


Loading