diff --git a/src/runmodes.c b/src/runmodes.c index 7d5764fa25..8b5739faf2 100644 --- a/src/runmodes.c +++ b/src/runmodes.c @@ -1947,12 +1947,12 @@ int RunModeIdsPcapAuto(DetectEngineCtx *de_ctx, char *iface) { } for (cpu = 0; cpu < ncpus; cpu++) { - snprintf(tname, 11,"Detect%"PRIu16, cpu); + snprintf(tname, sizeof(tname),"Detect%"PRIu16, cpu+1); if (tname == NULL) break; char *thread_name = strdup(tname); - SCLogInfo("Assigning %s affinity to cpu %u", thread_name, cpu); + SCLogDebug("Assigning %s affinity to cpu %u", thread_name, cpu); ThreadVars *tv_detect_ncpu = TmThreadCreatePacketHandler(thread_name,"stream-queue1","simple","verdict-queue","simple","1slot"); if (tv_detect_ncpu == NULL) { @@ -2114,12 +2114,12 @@ int RunModeFilePcapAuto(DetectEngineCtx *de_ctx, char *file) { } for (cpu = 0; cpu < ncpus; cpu++) { - snprintf(tname, 11,"Detect%"PRIu16, cpu); + snprintf(tname, sizeof(tname),"Detect%"PRIu16, cpu+1); if (tname == NULL) break; char *thread_name = strdup(tname); - SCLogInfo("Assigning %s affinity to cpu %u", thread_name, cpu); + SCLogDebug("Assigning %s affinity to cpu %u", thread_name, cpu); ThreadVars *tv_detect_ncpu = TmThreadCreatePacketHandler(thread_name,"stream-queue1","simple","alert-queue1","simple","1slot"); if (tv_detect_ncpu == NULL) { @@ -2260,12 +2260,12 @@ int RunModeIpsIPFWAuto(DetectEngineCtx *de_ctx) { } for (cpu = 0; cpu < ncpus; cpu++) { - snprintf(tname, 11,"Detect%"PRIu16, cpu); + snprintf(tname, sizeof(tname),"Detect%"PRIu16, cpu+1); if (tname == NULL) break; char *thread_name = strdup(tname); - SCLogInfo("Assigning %s affinity to cpu %u", thread_name, cpu); + SCLogDebug("Assigning %s affinity to cpu %u", thread_name, cpu); ThreadVars *tv_detect_ncpu = TmThreadCreatePacketHandler(thread_name,"stream-queue1","simple","verdict-queue","simple","1slot"); if (tv_detect_ncpu == NULL) { @@ -2447,12 +2447,12 @@ int RunModeIpsNFQAuto(DetectEngineCtx *de_ctx, char *nfq_id) { } for (cpu = 0; cpu < ncpus; cpu++) { - snprintf(tname, 11,"Detect%"PRIu16, cpu); + snprintf(tname, sizeof(tname),"Detect%"PRIu16, cpu+1); if (tname == NULL) break; char *thread_name = strdup(tname); - SCLogInfo("Assigning %s affinity to cpu %u", thread_name, cpu); + SCLogDebug("Assigning %s affinity to cpu %u", thread_name, cpu); ThreadVars *tv_detect_ncpu = TmThreadCreatePacketHandler(thread_name,"stream-queue1","simple","verdict-queue","simple","1slot"); if (tv_detect_ncpu == NULL) { @@ -2633,12 +2633,12 @@ int RunModeIdsPfringAuto(DetectEngineCtx *de_ctx, char *iface) { } for (cpu = 0; cpu < ncpus; cpu++) { - snprintf(tname, 11,"Detect%"PRIu16, cpu); + snprintf(tname, sizeof(tname),"Detect%"PRIu16, cpu+1); if (tname == NULL) break; char *thread_name = strdup(tname); - SCLogInfo("Assigning %s affinity to cpu %u", thread_name, cpu); + SCLogDebug("Assigning %s affinity to cpu %u", thread_name, cpu); ThreadVars *tv_detect_ncpu = TmThreadCreatePacketHandler(thread_name,"stream-queue1","simple","verdict-queue","simple","1slot"); if (tv_detect_ncpu == NULL) { diff --git a/src/tm-threads.c b/src/tm-threads.c index 6ff1bc22c9..7760e75165 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -605,7 +605,7 @@ static int SetCPUAffinity(uint16_t cpuid) { printf("Warning: sched_setaffinity failed (%" PRId32 "): %s\n", r, strerror(errno)); return -1; } - SCLogInfo("CPU Affinity for thread %lu set to CPU %" PRId32, SCGetThreadIdLong(), cpu); + SCLogDebug("CPU Affinity for thread %lu set to CPU %" PRId32, SCGetThreadIdLong(), cpu); return 0; } @@ -636,12 +636,12 @@ void TmThreadPrioSummary(char *tname) pthread_getschedparam (pthread_self (), &my_policy, &my_param); - SCLogInfo("at %s, threading policy: %s, priority %"PRId32"\n", tname, + SCLogDebug("at %s, threading policy: %s, priority %"PRId32"", tname, (my_policy == SCHED_FIFO ? "Fifo" : (my_policy == SCHED_RR ? "RR" : (my_policy == SCHED_OTHER ? "Other" : "unknown"))), my_param.sched_priority); - SCLogInfo("at %s, Min prio: %"PRId32" Max prio: %"PRId32"", tname, sched_get_priority_min(my_policy), sched_get_priority_max(my_policy)); + SCLogDebug("at %s, Min prio: %"PRId32" Max prio: %"PRId32"", tname, sched_get_priority_min(my_policy), sched_get_priority_max(my_policy)); } @@ -1056,7 +1056,7 @@ TmEcode TmThreadSpawn(ThreadVars *tv) if (ret != 0) { SCLogInfo("Error setting thread policy to SCHED_RR"); } else { - SCLogInfo("Thread policy SCHED_RR set for thread %s. Old prio: %"PRId32, tv->name, param.sched_priority); + SCLogDebug("Thread policy SCHED_RR set for thread %s. Old prio: %"PRId32, tv->name, param.sched_priority); param.sched_priority = tv->thread_priority; ret = pthread_attr_setschedparam(&attr, ¶m); @@ -1065,7 +1065,7 @@ TmEcode TmThreadSpawn(ThreadVars *tv) /* Get the old default priority */ pthread_attr_getschedparam(&attr, ¶m); } else { - SCLogInfo("Thread priority %"PRId32" set for thread %s", tv->thread_priority, tv->name); + SCLogDebug("Thread priority %"PRId32" set for thread %s", tv->thread_priority, tv->name); } } }