Update threads to use global thread names.

Update FlowManager/Recycler to use global name.
Also add # into thread number.
Update af-packet to use global threadnames.
Update pcap to use global threadnames.
Update pfring to use global threadnames.
Update erf-dag to use global threadnames.
Update nflog to use global threadnames.
Update netmap to use global threadnames.
Update napatech to use global threadnames.
pull/2050/head
Zachary Rasmor 10 years ago committed by Victor Julien
parent 1bfebae8c4
commit 41c768ce28

@ -121,8 +121,11 @@ void FlowDisableFlowManagerThread(void)
/* flow manager thread(s) is/are a part of mgmt threads */
tv = tv_root[TVT_MGMT];
while (tv != NULL) {
if (strncasecmp(tv->name, "FM", 2) == 0) {
while (tv != NULL)
{
if (strncasecmp(tv->name, thread_name_flow_mgr,
strlen(thread_name_flow_mgr)) == 0)
{
TmThreadsSetFlag(tv, THV_KILL);
cnt++;
@ -731,11 +734,12 @@ void FlowManagerThreadSpawn()
StatsRegisterGlobalCounter("flow.memuse", FlowGetMemuse);
uint32_t u;
for (u = 0; u < flowmgr_number; u++) {
for (u = 0; u < flowmgr_number; u++)
{
ThreadVars *tv_flowmgr = NULL;
char name[32] = "";
snprintf(name, sizeof(name), "FM%02u", u+1);
snprintf(name, sizeof(name), "%s#%02u", thread_name_flow_mgr, u+1);
tv_flowmgr = TmThreadCreateMgmtThreadByName(SCStrdup(name),
"FlowManager", 0);
@ -894,16 +898,12 @@ void FlowRecyclerThreadSpawn()
uint32_t u;
for (u = 0; u < flowrec_number; u++) {
for (u = 0; u < flowrec_number; u++)
{
ThreadVars *tv_flowmgr = NULL;
<<<<<<< HEAD
char name[32];
snprintf(name, sizeof(name), "FlowRecyclerThread%02u", u+1);
=======
char name[32] = "";
snprintf(name, sizeof(name), "FR%02u", u+1);
>>>>>>> Changed naming of flowmanager/recycler.
snprintf(name, sizeof(name), "%s#%02u", thread_name_flow_rec, u+1);
tv_flowmgr = TmThreadCreateMgmtThreadByName(SCStrdup(name),
"FlowRecycler", 0);
@ -956,8 +956,11 @@ void FlowDisableFlowRecyclerThread(void)
/* flow recycler thread(s) is/are a part of mgmt threads */
tv = tv_root[TVT_MGMT];
while (tv != NULL) {
if (strncasecmp(tv->name, "FR", 2) == 0) {
while (tv != NULL)
{
if (strncasecmp(tv->name, thread_name_flow_rec,
strlen(thread_name_flow_rec)) == 0)
{
TmThreadsSetFlag(tv, THV_KILL);
cnt++;

@ -514,7 +514,7 @@ int RunModeIdsAFPAutoFp(void)
ret = RunModeSetLiveCaptureAutoFp(ParseAFPConfig,
AFPConfigGeThreadsCount,
"ReceiveAFP",
"DecodeAFP", "RxAFP",
"DecodeAFP", thread_name_autofp,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Unable to start runmode");
@ -556,7 +556,7 @@ int RunModeIdsAFPSingle(void)
ret = RunModeSetLiveCaptureSingle(ParseAFPConfig,
AFPConfigGeThreadsCount,
"ReceiveAFP",
"DecodeAFP", "AFPacket",
"DecodeAFP", thread_name_single,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Unable to start runmode");
@ -601,7 +601,7 @@ int RunModeIdsAFPWorkers(void)
ret = RunModeSetLiveCaptureWorkers(ParseAFPConfig,
AFPConfigGeThreadsCount,
"ReceiveAFP",
"DecodeAFP", "AFPacket",
"DecodeAFP", thread_name_workers,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Unable to start runmode");

@ -85,7 +85,7 @@ int RunModeIdsErfDagSingle(void)
DagConfigGetThreadCount,
"ReceiveErfDag",
"DecodeErfDag",
"RxDAG",
thread_name_single,
NULL);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "DAG single runmode failed to start");
@ -111,7 +111,7 @@ int RunModeIdsErfDagAutoFp(void)
DagConfigGetThreadCount,
"ReceiveErfDag",
"DecodeErfDag",
"RxDAG",
thread_name_autofp,
NULL);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "DAG autofp runmode failed to start");
@ -137,7 +137,7 @@ int RunModeIdsErfDagWorkers(void)
DagConfigGetThreadCount,
"ReceiveErfDag",
"DecodeErfDag",
"RxDAG",
thread_name_workers,
NULL);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "DAG workers runmode failed to start");

@ -204,12 +204,12 @@ static int NapatechInit(int runmode)
case NT_RUNMODE_AUTOFP:
ret = RunModeSetLiveCaptureAutoFp(NapatechConfigParser, NapatechGetThreadsCount,
"NapatechStream", "NapatechDecode",
"RxNT", NULL);
thread_name_autofp, NULL);
break;
case NT_RUNMODE_WORKERS:
ret = RunModeSetLiveCaptureWorkers(NapatechConfigParser, NapatechGetThreadsCount,
"NapatechStream", "NapatechDecode",
"RxNT", NULL);
thread_name_workers, NULL);
break;
default:
ret = -1;

@ -372,7 +372,7 @@ int RunModeIdsNetmapAutoFp(void)
ParseNetmapConfig,
NetmapConfigGeThreadsCount,
"ReceiveNetmap",
"DecodeNetmap", "RxNetmap",
"DecodeNetmap", thread_name_autofp,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Unable to start runmode");
@ -405,7 +405,7 @@ int RunModeIdsNetmapSingle(void)
ParseNetmapConfig,
NetmapConfigGeThreadsCount,
"ReceiveNetmap",
"DecodeNetmap", "NetmapPkt",
"DecodeNetmap", thread_name_single,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Unable to start runmode");
@ -441,7 +441,7 @@ int RunModeIdsNetmapWorkers(void)
ParseNetmapConfig,
NetmapConfigGeThreadsCount,
"ReceiveNetmap",
"DecodeNetmap", "NetmapPkt",
"DecodeNetmap", thread_name_workers,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Unable to start runmode");

@ -184,7 +184,7 @@ int RunModeIdsNflogAutoFp(void)
NflogConfigGeThreadsCount,
"ReceiveNFLOG",
"DecodeNFLOG",
"RecvNFLOG",
thread_name_autofp,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Unable to start runmode");
@ -212,7 +212,7 @@ int RunModeIdsNflogSingle(void)
NflogConfigGeThreadsCount,
"ReceiveNFLOG",
"DecodeNFLOG",
"RecvNFLOG",
thread_name_single,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Unable to start runmode");
@ -240,7 +240,7 @@ int RunModeIdsNflogWorkers(void)
NflogConfigGeThreadsCount,
"ReceiveNFLOG",
"DecodeNFLOG",
"RecvNFLOG",
thread_name_workers,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Unable to start runmode");

@ -242,7 +242,7 @@ int RunModeIdsPcapSingle(void)
ret = RunModeSetLiveCaptureSingle(ParsePcapConfig,
PcapConfigGeThreadsCount,
"ReceivePcap",
"DecodePcap", "PcapLive",
"DecodePcap", thread_name_single,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Runmode start failed");
@ -283,7 +283,7 @@ int RunModeIdsPcapAutoFp(void)
ret = RunModeSetLiveCaptureAutoFp(ParsePcapConfig,
PcapConfigGeThreadsCount,
"ReceivePcap",
"DecodePcap", "RxPcap",
"DecodePcap", thread_name_autofp,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Runmode start failed");
@ -315,7 +315,7 @@ int RunModeIdsPcapWorkers(void)
ret = RunModeSetLiveCaptureWorkers(ParsePcapConfig,
PcapConfigGeThreadsCount,
"ReceivePcap",
"DecodePcap", "RxPcap",
"DecodePcap", thread_name_workers,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Unable to start runmode");

@ -437,7 +437,7 @@ int RunModeIdsPfringAutoFp(void)
ret = RunModeSetLiveCaptureAutoFp(tparser,
PfringConfigGeThreadsCount,
"ReceivePfring",
"DecodePfring", "RxPFR",
"DecodePfring", thread_name_autofp,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Runmode start failed");
@ -474,7 +474,7 @@ int RunModeIdsPfringSingle(void)
ret = RunModeSetLiveCaptureSingle(tparser,
PfringConfigGeThreadsCount,
"ReceivePfring",
"DecodePfring", "RxPFR",
"DecodePfring", thread_name_single,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Runmode start failed");
@ -511,7 +511,7 @@ int RunModeIdsPfringWorkers(void)
ret = RunModeSetLiveCaptureWorkers(tparser,
PfringConfigGeThreadsCount,
"ReceivePfring",
"DecodePfring", "RxPFR",
"DecodePfring", thread_name_workers,
live_dev);
if (ret != 0) {
SCLogError(SC_ERR_RUNMODE, "Runmode start failed");

Loading…
Cancel
Save