Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
e23f74c7
Commit
e23f74c7
authored
Aug 11, 2009
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle pre-existing records, wipe_all and repack (ldb users.ldb trace)
parent
1bc7c436
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
320 additions
and
226 deletions
+320
-226
ccan/tdb/tools/keywords.c
ccan/tdb/tools/keywords.c
+38
-35
ccan/tdb/tools/keywords.gperf
ccan/tdb/tools/keywords.gperf
+4
-3
ccan/tdb/tools/replay_trace.c
ccan/tdb/tools/replay_trace.c
+278
-188
No files found.
ccan/tdb/tools/keywords.c
View file @
e23f74c7
...
...
@@ -35,10 +35,10 @@
struct
op_table
{
const
char
*
name
;
enum
op_type
type
;
void
(
*
enhance_op
)(
c
onst
char
*
filename
,
struct
op
op
[],
unsigned
int
op_num
,
char
*
words
[]);
void
(
*
enhance_op
)(
c
har
*
filename
[],
struct
op
op
[]
,
unsigned
file
,
unsigned
op_num
,
char
*
words
[]);
};
/* maximum key range =
48
, duplicates = 0 */
/* maximum key range =
53
, duplicates = 0 */
#ifdef __GNUC__
__inline
...
...
@@ -52,32 +52,32 @@ hash_keyword (register const char *str, register unsigned int len)
{
static
const
unsigned
char
asso_values
[]
=
{
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
20
,
56
,
30
,
5
,
0
,
0
,
5
,
5
,
56
,
56
,
0
,
0
,
0
,
20
,
56
,
20
,
56
,
56
,
0
,
5
,
0
,
56
,
0
,
56
,
5
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
45
,
61
,
30
,
5
,
0
,
0
,
5
,
5
,
61
,
61
,
0
,
0
,
0
,
20
,
61
,
20
,
61
,
25
,
0
,
5
,
0
,
61
,
0
,
61
,
5
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
,
61
};
return
len
+
asso_values
[(
unsigned
char
)
str
[
4
]]
+
asso_values
[(
unsigned
char
)
str
[
len
-
1
]];
}
...
...
@@ -93,11 +93,11 @@ find_keyword (register const char *str, register unsigned int len)
{
enum
{
TOTAL_KEYWORDS
=
3
4
,
TOTAL_KEYWORDS
=
3
5
,
MIN_WORD_LENGTH
=
8
,
MAX_WORD_LENGTH
=
30
,
MIN_HASH_VALUE
=
8
,
MAX_HASH_VALUE
=
55
MAX_HASH_VALUE
=
60
};
static
const
struct
op_table
wordlist
[]
=
...
...
@@ -112,7 +112,7 @@ find_keyword (register const char *str, register unsigned int len)
#line 16 "keywords.gperf"
{
"tdb_lockall"
,
OP_TDB_LOCKALL
,
op_add_nothing
,},
#line 36 "keywords.gperf"
{
"tdb_wipe_all"
,
OP_TDB_WIPE_ALL
,
op_add_
nothing
,},
{
"tdb_wipe_all"
,
OP_TDB_WIPE_ALL
,
op_add_
wipe_all
,},
#line 20 "keywords.gperf"
{
"tdb_unlockall"
,
OP_TDB_UNLOCKALL
,
op_add_nothing
,},
#line 48 "keywords.gperf"
...
...
@@ -153,8 +153,8 @@ find_keyword (register const char *str, register unsigned int len)
#line 41 "keywords.gperf"
{
"tdb_traverse_read_start"
,
OP_TDB_TRAVERSE_READ_START
,
op_add_traverse_start
,},
{
""
},
#line
34
"keywords.gperf"
{
"tdb_
append"
,
OP_TDB_APPEND
,
op_add_append
,},
#line
50
"keywords.gperf"
{
"tdb_
repack"
,
OP_TDB_REPACK
,
op_add_nothing
,},
#line 47 "keywords.gperf"
{
"tdb_nextkey"
,
OP_TDB_NEXTKEY
,
op_add_key_data
,},
{
""
},
{
""
},
{
""
},
...
...
@@ -181,7 +181,10 @@ find_keyword (register const char *str, register unsigned int len)
{
"tdb_chainlock_read"
,
OP_TDB_CHAINLOCK_READ
,
op_add_chainlock
,},
{
""
},
#line 30 "keywords.gperf"
{
"tdb_chainunlock_read"
,
OP_TDB_CHAINUNLOCK_READ
,
op_analyze_chainlock
,}
{
"tdb_chainunlock_read"
,
OP_TDB_CHAINUNLOCK_READ
,
op_analyze_chainlock
,},
{
""
},
{
""
},
{
""
},
{
""
},
#line 34 "keywords.gperf"
{
"tdb_append"
,
OP_TDB_APPEND
,
op_add_append
,}
};
if
(
len
<=
MAX_WORD_LENGTH
&&
len
>=
MIN_WORD_LENGTH
)
...
...
ccan/tdb/tools/keywords.gperf
View file @
e23f74c7
...
...
@@ -4,8 +4,8 @@
struct op_table {
const char *name;
enum op_type type;
void (*enhance_op)(c
onst char *filename
,
struct op op[], unsigned int
op_num, char *words[]);
void (*enhance_op)(c
har *filename[], struct op op[]
,
unsigned file, unsigned
op_num, char *words[]);
};
%define hash-function-name hash_keyword
%define lookup-function-name find_keyword
...
...
@@ -33,7 +33,7 @@ tdb_exists, OP_TDB_EXISTS, op_add_key_ret,
tdb_store, OP_TDB_STORE, op_add_store,
tdb_append, OP_TDB_APPEND, op_add_append,
tdb_get_seqnum, OP_TDB_GET_SEQNUM, op_add_seqnum,
tdb_wipe_all, OP_TDB_WIPE_ALL, op_add_
nothing
,
tdb_wipe_all, OP_TDB_WIPE_ALL, op_add_
wipe_all
,
tdb_transaction_start, OP_TDB_TRANSACTION_START, op_add_transaction,
tdb_transaction_cancel, OP_TDB_TRANSACTION_CANCEL, op_analyze_transaction,
tdb_transaction_commit, OP_TDB_TRANSACTION_COMMIT, op_analyze_transaction,
...
...
@@ -47,3 +47,4 @@ tdb_firstkey, OP_TDB_FIRSTKEY, op_add_key,
tdb_nextkey, OP_TDB_NEXTKEY, op_add_key_data,
tdb_fetch, OP_TDB_FETCH, op_add_key_data,
tdb_delete, OP_TDB_DELETE, op_add_key_ret,
tdb_repack, OP_TDB_REPACK, op_add_nothing,
ccan/tdb/tools/replay_trace.c
View file @
e23f74c7
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment