Cleanup threading cpu affinity and prio output.

remotes/origin/master-1.0.x
Victor Julien 17 years ago
parent c1e2e53809
commit b28488508b

@ -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) {

@ -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, &param);
@ -1065,7 +1065,7 @@ TmEcode TmThreadSpawn(ThreadVars *tv)
/* Get the old default priority */
pthread_attr_getschedparam(&attr, &param);
} 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);
}
}
}

Loading…
Cancel
Save