-
Notifications
You must be signed in to change notification settings - Fork 32
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
CTL: Add a CTL sources to the UMF #913
base: main
Are you sure you want to change the base?
Conversation
src/ctl/ctl.h
Outdated
* ctl.h -- internal declaration of statistics and control related structures | ||
*/ | ||
|
||
#ifndef PMDK_CTL_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls update all define's to use naming like: UMF_*_H
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not done, e.g. CTL_DEBUG_H
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look once again, this snippet is outdated
src/ctl/ctl.c
Outdated
*/ | ||
int ctl_load_config_from_string(struct ctl *ctl, void *ctx, | ||
const char *cfg_string) { | ||
// LOG(3, "ctl %p ctx %p cfg_string \"%s\"", ctl, ctx, cfg_string); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOG
could be replaced with our LOG_*
macros
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporarily deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave this issue open, for LOGs to come back, when ready
5c52d3a
to
cdd3d46
Compare
src/ctl/alloc.c
Outdated
return fn_malloc(size); | ||
} | ||
|
||
static __thread int realloc_num; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this fault injection? this was part of testing infra.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed, thanks
4f30764
to
0f8383e
Compare
0d68c68
to
44ec630
Compare
dc1d821
to
76b70bc
Compare
b6d922a
to
6cc7810
Compare
int value = 0; | ||
ctl_query(ctl_handler, NULL, CTL_QUERY_PROGRAMMATIC, | ||
"debug.heap.alloc_pattern", CTL_QUERY_READ, &value); | ||
ASSERT_EQ(value, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we definitely need more complex tests
@KFilipek please consider moving this PR to draft and re-request review when ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now all changes are in a single commit, at best the original code should be in the first commit and all our changes in a sep. one - this would be easier to distingush our changes, e.g. in case of any issues found
@@ -232,9 +232,8 @@ function(add_umf_target_compile_options name) | |||
PRIVATE -fPIC | |||
-Wall | |||
-Wextra | |||
-Wpedantic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I you want to add this change in this PR, it should be in a sep. commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/ctl/ctl.h
Outdated
* ctl.h -- internal declaration of statistics and control related structures | ||
*/ | ||
|
||
#ifndef PMDK_CTL_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not done, e.g. CTL_DEBUG_H
@@ -0,0 +1,590 @@ | |||
// SPDX-License-Identifier: BSD-3-Clause |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's usually first copyright, then a license txt, then SPDX tag, e.g.
/*
*
* Copyright (C) 2023-2024 Intel Corporation
*
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*
*/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? 😉
I cannot reply in thread related with that you see
#913 (comment)
df3c47f
to
ecf3785
Compare
This commit introduces sources and compilation of the CTL. The CTL sources are copied from: https://github.com/pmem/pmdk/tree/master/src/common Signed-off-by: Krzysztof Filipek <[email protected]>
-Wformat-security | ||
-Wcast-qual | ||
-Wno-cast-qual |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you disable this flag?
}; | ||
|
||
struct ctl_argument { | ||
size_t dest_size; /* sizeof the entire argument */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: size of
* This function opens up the config file, allocates a buffer of size equal to | ||
* the size of the file, reads its content and sanitizes it for ctl_load_config. | ||
*/ | ||
#ifdef WINDOWS_API_NEEDED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unknown define. The code looks like it should work on linux.
if (endptr == str || errno != 0) { | ||
return LLONG_MIN; | ||
} | ||
errno = olderrno; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does errno
have to be restored?
* query has been handled. | ||
*/ | ||
struct ctl_index_utlist *indexes = NULL; | ||
indexes = Zalloc(sizeof(*indexes)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check for NULL
Description
This commit introduces sources and compilation of the CTL.
Checklists
TODO:
Other: