profiling: fix const compiler warnings

pull/2732/head
Jason Ish 8 years ago committed by Victor Julien
parent 43b0bc8c8e
commit bb10bd7fca

@ -38,7 +38,7 @@ __thread int record_locks = 0;
int profiling_locks_enabled = 0; int profiling_locks_enabled = 0;
int profiling_locks_output_to_file = 0; int profiling_locks_output_to_file = 0;
char *profiling_locks_file_name = NULL; char *profiling_locks_file_name = NULL;
char *profiling_locks_file_mode = "a"; const char *profiling_locks_file_mode = "a";
typedef struct LockRecord_ { typedef struct LockRecord_ {
char *file; // hash char *file; // hash
@ -106,7 +106,7 @@ int LockRecordInitHash()
return 0; return 0;
} }
void LockRecordAdd(ProfilingLock *l) static void LockRecordAdd(ProfilingLock *l)
{ {
LockRecord fn = { NULL, NULL, 0,0,0,0,0,0}, *ptr = &fn; LockRecord fn = { NULL, NULL, 0,0,0,0,0,0}, *ptr = &fn;
fn.file = l->file; fn.file = l->file;
@ -153,7 +153,7 @@ void SCProfilingAddPacketLocks(void *p)
} }
} }
void SCProfilingListLocks(void) static void SCProfilingListLocks(void)
{ {
FILE *fp = NULL; FILE *fp = NULL;
@ -180,7 +180,7 @@ void SCProfilingListLocks(void)
while (b) { while (b) {
LockRecord *r = HashListTableGetListData(b); LockRecord *r = HashListTableGetListData(b);
char *lock; const char *lock;
switch (r->type) { switch (r->type) {
case LOCK_MUTEX: case LOCK_MUTEX:
lock = "mtx"; lock = "mtx";

@ -55,7 +55,7 @@ static FILE *packet_profile_csv_fp = NULL;
extern int profiling_locks_enabled; extern int profiling_locks_enabled;
extern int profiling_locks_output_to_file; extern int profiling_locks_output_to_file;
extern char *profiling_locks_file_name; extern char *profiling_locks_file_name;
extern char *profiling_locks_file_mode; extern const char *profiling_locks_file_mode;
typedef struct SCProfilePacketData_ { typedef struct SCProfilePacketData_ {
uint64_t min; uint64_t min;
@ -255,8 +255,7 @@ SCProfilingInit(void)
const char *filename = ConfNodeLookupChildValue(conf, "filename"); const char *filename = ConfNodeLookupChildValue(conf, "filename");
if (filename != NULL) { if (filename != NULL) {
char *log_dir; const char *log_dir = ConfigGetLogDirectory();
log_dir = ConfigGetLogDirectory();
profiling_locks_file_name = SCMalloc(PATH_MAX); profiling_locks_file_name = SCMalloc(PATH_MAX);
if (unlikely(profiling_locks_file_name == NULL)) { if (unlikely(profiling_locks_file_name == NULL)) {

Loading…
Cancel
Save