Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set log recording dir before enable recording #300

Merged
merged 1 commit into from
Aug 28, 2017
Merged
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
25 changes: 15 additions & 10 deletions orchagent/saihelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,10 @@ void initSaiRedis(const string &record_location)
* to be performed, and they should be executed before creating switch.
*/

/* Disable/enable SAI Redis recording */
sai_attribute_t attr;
attr.id = SAI_REDIS_SWITCH_ATTR_RECORD;
attr.value.booldata = gSairedisRecord;
sai_status_t status;

sai_status_t status = sai_switch_api->set_switch_attribute(gSwitchId, &attr);
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to %s SAI Redis recording, rv:%d",
gSairedisRecord ? "enable" : "disable", status);
exit(EXIT_FAILURE);
}
/* set recording dir before enable recording */

if (gSairedisRecord)
{
Expand All @@ -200,6 +192,19 @@ void initSaiRedis(const string &record_location)
}
}

/* Disable/enable SAI Redis recording */

attr.id = SAI_REDIS_SWITCH_ATTR_RECORD;
attr.value.booldata = gSairedisRecord;

status = sai_switch_api->set_switch_attribute(gSwitchId, &attr);
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to %s SAI Redis recording, rv:%d",
gSairedisRecord ? "enable" : "disable", status);
exit(EXIT_FAILURE);
}

attr.id = SAI_REDIS_SWITCH_ATTR_USE_PIPELINE;
attr.value.booldata = true;

Expand Down