Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bake
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
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
sds
bake
Commits
9b72b5a8
Commit
9b72b5a8
authored
Apr 29, 2019
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ability to print region ids for debugging
parent
81938b7a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
0 deletions
+31
-0
include/bake.h
include/bake.h
+10
-0
src/bake-copy-from.c
src/bake-copy-from.c
+4
-0
src/bake-copy-to.c
src/bake-copy-to.c
+4
-0
src/util.c
src/util.c
+13
-0
No files found.
include/bake.h
View file @
9b72b5a8
...
...
@@ -47,6 +47,16 @@ typedef struct {
*/
void
bake_perror
(
char
*
s
,
int
ret
);
/**
* Convert region id into printable string for debugging purposes
*
* @param[in] str string to fill in
* @param[in] size length of string, not including terminator. If rid
* string is longer than this it will be truncated.
* @param[in] rid region_id
*/
void
bake_print_dbg_region_id_t
(
char
*
str
,
size_t
size
,
bake_region_id_t
rid
);
#ifdef __cplusplus
}
#endif
...
...
src/bake-copy-from.c
View file @
9b72b5a8
...
...
@@ -36,6 +36,7 @@ int main(int argc, char **argv)
char
*
local_region
;
int
region_fd
;
uint64_t
size
;
char
region_str
[
128
];
if
(
argc
!=
6
)
{
...
...
@@ -111,6 +112,9 @@ int main(int argc, char **argv)
}
close
(
region_fd
);
bake_print_dbg_region_id_t
(
region_str
,
127
,
rid
);
printf
(
"# will read bake region %s
\n
"
,
region_str
);
#ifdef USE_SIZECHECK_HEADERS
uint64_t
check_size
;
ret
=
bake_get_size
(
bph
,
rid
,
&
check_size
);
...
...
src/bake-copy-to.c
View file @
9b72b5a8
...
...
@@ -38,6 +38,7 @@ int main(int argc, char **argv)
char
*
local_region
;
int
region_fd
;
char
region_file
[
128
];
char
region_str
[
128
];
#ifdef USE_SIZECHECK_HEADERS
uint64_t
check_size
;
#endif
...
...
@@ -162,6 +163,9 @@ int main(int argc, char **argv)
return
(
-
1
);
}
bake_print_dbg_region_id_t
(
region_str
,
127
,
rid
);
printf
(
"# created bake region %s
\n
"
,
region_str
);
/* transfer data */
ret
=
bake_write
(
bph
,
...
...
src/util.c
View file @
9b72b5a8
...
...
@@ -7,6 +7,8 @@
#include "bake-config.h"
#include "bake.h"
#include <stdio.h>
#include <inttypes.h>
#include <libpmemobj.h>
static
char
*
bake_err_str
(
int
ret
)
{
...
...
@@ -64,3 +66,14 @@ void bake_perror(char *s, int err)
fprintf
(
stderr
,
"%s
\n
"
,
error_string
);
}
void
bake_print_dbg_region_id_t
(
char
*
str
,
size_t
size
,
bake_region_id_t
rid
)
{
PMEMoid
*
oid
;
/* NOTE: this is fragile. Would break if pmemobj format changes. */
oid
=
(
PMEMoid
*
)
rid
.
data
;
snprintf
(
str
,
size
,
"%u:%"
PRIu64
":%"
PRIu64
,
rid
.
type
,
oid
->
pool_uuid_lo
,
oid
->
off
);
return
;
}
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