From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by dpdk.org (Postfix) with ESMTP id 06D72C488 for ; Sun, 26 Jul 2015 23:55:57 +0200 (CEST) Received: by wibud3 with SMTP id ud3so117989432wib.1 for ; Sun, 26 Jul 2015 14:55:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=EKNMibFwkan2FNreSnaURokegHyHSgZpefHub9oNFEU=; b=j33dWFing7ZkrFOUVNJxl0XAmqzfWAx02WGLy+PB8AM2ItxcRdsUVSlWU2g0V3E3N7 7fAK0mo56kBPtmYoRKRcTnzf+uIbTVLOlj0dJb62OMQunMkqRUEf/pMvX/T/sUUqHzS6 aZWm2qQq8QXlA1Y9vXLJfohpsFxdHo/qz+bFdTkZT/P2iLD5n+96nOm8ONw+/OqakdQW wkyLuuvyPYubeJv3KAhBwQ5Yxld0KX1cKMgmJRwPvSYLI3TqeLLs+Utk/+JkRTS3fxIB WoBRF+36RhF4S9S1Neot2SVmVihjUeKEsv4kDBlLooVmGI8kWnPZlQ4yza41CdZ91FOf 6iZQ== X-Gm-Message-State: ALoCoQmoPW4f/hzgk8CzHBBGkjwMcw38xT4u47CVz6Ba4yy8/5axgjO1e+i0b1QM9rUesV6bSkp2 X-Received: by 10.180.37.200 with SMTP id a8mr17369744wik.26.1437947756875; Sun, 26 Jul 2015 14:55:56 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id r19sm10200834wib.7.2015.07.26.14.55.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jul 2015 14:55:55 -0700 (PDT) From: Thomas Monjalon To: Ravi Kerur Date: Sun, 26 Jul 2015 23:54:40 +0200 Message-ID: <2280623.OZV87NhkWH@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <1429736803-16943-1-git-send-email-rkerur@gmail.com> References: <1429736748-16874-1-git-send-email-rkerur@gmail.com> <1429736803-16943-1-git-send-email-rkerur@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] Use pthread_setname APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2015 21:55:57 -0000 Hi Ravi, It seems to be a nice improvement but it needs some cleanup. Checkpatch returns some errors. 2015-04-22 14:06, Ravi Kerur: > use pthread_setname_np and pthread_set_name_np for Linux and > FreeBSD respectively. > Restrict pthread name len to 16 via config for both Linux and FreeBSD. One of the most important part of the commit message is to answer why. Here you probably should explain that the goal is to help debugging. > # > +# Max pthread name len > +# > +CONFIG_RTE_MAX_THREAD_NAME_LEN=16 It doesn't have to be configurable. A define would be sufficient. > + snprintf(thread_name, RTE_MAX_THREAD_NAME_LEN, "print-stats"); Why not put this line just before use of thread_name? > + > + ret = pthread_create(&tid, NULL, (void*)print_stats, NULL ); > + > + if (ret != 0) > + rte_exit(EXIT_FAILURE, > + "Cannot create print-stats thread\n"); > + > + ret = pthread_setname_np(tid, thread_name); > + > + if (ret != 0) > + RTE_LOG(ERR, VHOST_CONFIG, > + "Cannot set print-stats name\n"); [...] > + pthread_set_name_np(lcore_config[i].thread_id, > + (const char *)thread_name); Is const casting really needed?