forked from sonic-net/sonic-sairedis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install rdb-cli from librdb into syncd0 container
- Loading branch information
1 parent
963b958
commit f86bc06
Showing
5 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
SUBDIRS = meta lib vslib proxylib pyext | ||
|
||
if SYNCD | ||
SUBDIRS += syncd saiplayer saidump saidiscovery saisdkdump saiasiccmp tests unittest | ||
SUBDIRS += syncd saiplayer saidump rdb saidiscovery saisdkdump saiasiccmp tests unittest | ||
endif | ||
|
||
ACLOCAL_AMFLAGS = -I m4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
usr/bin/saidump | ||
usr/bin/rdb-cli | ||
usr/bin/saiplayer | ||
usr/bin/saisdkdump | ||
usr/bin/saidiscovery | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
bin_PROGRAMS = rdb-cli$(EXEEXT) | ||
rdb_cli_SOURCES = | ||
|
||
clone-repo: | ||
echo "Cloning repository..."; \ | ||
rm -rf librdb; \ | ||
git clone https://github.com/redis/librdb.git; \ | ||
cd librdb; \ | ||
git checkout b401df1e7025501c24f0c852aa32f6900fd888f7; \ | ||
cd .. | ||
|
||
update-submodules-and-build: clone-repo | ||
cd librdb && git submodule update --init --recursive && patch -p1 < ../format.patch && $(MAKE) | ||
cp ./librdb/bin/rdb-cli ./ | ||
rm -rf ./librdb | ||
|
||
rdb-cli$(EXEEXT): update-submodules-and-build | ||
|
||
clean-local: | ||
rm -rf ./librdb | ||
|
||
install: | ||
cp rdb-cli $(DESTDIR)/usr/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/src/lib/parser.c b/src/lib/parser.c | ||
index 01504ba..c463fb4 100644 | ||
--- a/src/lib/parser.c | ||
+++ b/src/lib/parser.c | ||
@@ -2166,7 +2166,7 @@ RdbStatus elementModule(RdbParser *p) { | ||
IF_NOT_OK_RETURN(rdbLoadLen(p, NULL, &when, NULL, NULL)); | ||
if (unlikely(when_opcode != RDB_MODULE_OPCODE_UINT)) { | ||
RDB_reportError(p, RDB_ERR_MODULE_INVALID_WHEN_OPCODE, | ||
- "elementModule() : Invalid when opcode: %ld.", when_opcode); | ||
+ "elementModule() : Invalid when opcode: %" PRIu64 ".", when_opcode); | ||
return RDB_STATUS_ERROR; | ||
} | ||
} | ||
diff --git a/src/lib/parserRaw.c b/src/lib/parserRaw.c | ||
index 0e9f9c6..aa54ffc 100644 | ||
--- a/src/lib/parserRaw.c | ||
+++ b/src/lib/parserRaw.c | ||
@@ -729,7 +729,7 @@ RdbStatus elementRawModule(RdbParser *p) { | ||
IF_NOT_OK_RETURN(rdbLoadLen(p, NULL, &ma->when, NULL, NULL)); | ||
if (unlikely(ma->when_opcode != RDB_MODULE_OPCODE_UINT)) { | ||
RDB_reportError(p, RDB_ERR_MODULE_INVALID_WHEN_OPCODE, | ||
- "elementRawModule() : Invalid when opcode: %ld.", ma->when_opcode); | ||
+ "elementRawModule() : Invalid when opcode: %" PRIu64 ".", ma->when_opcode); | ||
return RDB_STATUS_ERROR; | ||
} | ||
/*** ENTER SAFE STATE ***/ | ||
@@ -1214,7 +1214,7 @@ static RdbStatus aggMakeRoom(RdbParser *p, size_t numBytesRq) { | ||
size_t freeRoomLeft = currBuff->len - currBuff->written; | ||
|
||
if (unlikely(p->maxRawSize < ctx->totalSize + numBytesRq)) { | ||
- RDB_reportError(p, RDB_ERR_MAX_RAW_LEN_EXCEEDED_FOR_KEY, "Maximum raw length exceeded for key (len=%lu)", | ||
+ RDB_reportError(p, RDB_ERR_MAX_RAW_LEN_EXCEEDED_FOR_KEY, "Maximum raw length exceeded for key (len=%" PRIuPTR ")", | ||
ctx->totalSize + numBytesRq); | ||
return RDB_STATUS_ERROR; | ||
} | ||
@@ -1287,7 +1287,7 @@ void printAggAraryDbg(RdbParser *p) { | ||
RawContext *ctx = &p->rawCtx; | ||
for (int i = 0; i <= ctx->curBulkIndex ; ++i) { | ||
BulkInfo *b = ctx->bulkArray+i; | ||
- printf("bulkArray[%d]: bulkType=%d ref=%p len=%lu written=%lu next=%p\n", | ||
+ printf("bulkArray[%d]: bulkType=%d ref=%p len=%" PRIuPTR " written=%" PRIuPTR " next=%p\n", | ||
i, b->bulkType, (void *)b->ref, b->len, b->written, (void *)b->next); | ||
} | ||
} |