summaryrefslogtreecommitdiffstats
path: root/src/publisher
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-11-02 13:46:05 +0200
committerimarom <imarom@cisco.com>2016-11-02 13:52:16 +0200
commit5ab7411f67636afc407701d4cf87a5060e5b8aa9 (patch)
tree261446f44c1f8d7edf5aa16c0f48c7ebe3a28c3d /src/publisher
parentaafa0ec65f83a6cb9f14782d90df42a8e6e412c3 (diff)
Trex threads - pin DPDK master thread to the master core
also, some names to the threads to make things clear and a script to show them Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/publisher')
-rw-r--r--src/publisher/trex_publisher.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/publisher/trex_publisher.cpp b/src/publisher/trex_publisher.cpp
index 67670593..224604e9 100644
--- a/src/publisher/trex_publisher.cpp
+++ b/src/publisher/trex_publisher.cpp
@@ -33,6 +33,8 @@ limitations under the License.
bool
TrexPublisher::Create(uint16_t port, bool disable){
+ char thread_name[256];
+
if (disable) {
return (true);
}
@@ -42,7 +44,15 @@ TrexPublisher::Create(uint16_t port, bool disable){
show_zmq_last_error("can't connect to ZMQ library");
}
+ /* change the pthread name temporarly for the socket creation */
+ pthread_getname_np(pthread_self(), thread_name, sizeof(thread_name));
+ pthread_setname_np(pthread_self(), "Trex Publisher");
+
m_publisher = zmq_socket (m_context, ZMQ_PUB);
+
+ /* restore it */
+ pthread_setname_np(pthread_self(), thread_name);
+
if ( m_context == 0 ) {
show_zmq_last_error("can't create ZMQ socket");
}