From patchwork Tue Feb 24 12:24:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 44938 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 85ACB20502 for ; Tue, 24 Feb 2015 12:24:59 +0000 (UTC) Received: by wghb13 with SMTP id b13sf3677182wgh.2 for ; Tue, 24 Feb 2015 04:24:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=T9MP/3It05CqxYMi0iddhPggDVerxFN0HXWST6oz6qw=; b=DL/DErHZLaUQ3S6LuCkQXbvl3wtblP80fQwMSm3s0/Z/7xuIWU5OM/Mi8bshvWl5Ox eGeSZkwb/nT65WMkNQTE5vwMgHZ+8/9kZm2s5MLym62kIQb8c/bGo7pLdJAz6x96016Y dp22Zz6ZPm1UwlbhoW2euhQqa4J2KoO+dehafhrVcLoO0SL0mYsX2xi+MOuoaYcgktP/ zQSd/VdphnoSWN1Bmb5xn1AUTtDFnr7BWRxE3sdcyl+O3KgRmUVTiVt1IlIcoJYBceSS i1sTKoNaXszSeJm6zHOpdIKdxmxKZO499pYxOflHFFWmKqtqC1+RFE2Dev8zES9bRIF5 wMIA== X-Gm-Message-State: ALoCoQn5uJs98s79u9YW5uoDySQISMV9s8jk2xJtkDibgkHptb1ZAX0NOTmVxnoE/f2ei2CAb6PE X-Received: by 10.112.199.69 with SMTP id ji5mr2084840lbc.0.1424780698806; Tue, 24 Feb 2015 04:24:58 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.178 with SMTP id p18ls559663lal.97.gmail; Tue, 24 Feb 2015 04:24:58 -0800 (PST) X-Received: by 10.112.135.196 with SMTP id pu4mr13923254lbb.41.1424780698593; Tue, 24 Feb 2015 04:24:58 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id ei9si22009802lad.89.2015.02.24.04.24.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 04:24:58 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by labge10 with SMTP id ge10so25150360lab.12 for ; Tue, 24 Feb 2015 04:24:58 -0800 (PST) X-Received: by 10.112.204.197 with SMTP id la5mr8283328lbc.29.1424780698448; Tue, 24 Feb 2015 04:24:58 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1875469lbj; Tue, 24 Feb 2015 04:24:57 -0800 (PST) X-Received: by 10.229.204.135 with SMTP id fm7mr36356777qcb.2.1424780697222; Tue, 24 Feb 2015 04:24:57 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id m3si38956270qcg.46.2015.02.24.04.24.50 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 04:24:57 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQEXf-0000WK-E5; Tue, 24 Feb 2015 12:24:47 +0000 Received: from mail-la0-f47.google.com ([209.85.215.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQEXZ-0000UK-KH for lng-odp@lists.linaro.org; Tue, 24 Feb 2015 12:24:41 +0000 Received: by lams18 with SMTP id s18so25263662lam.13 for ; Tue, 24 Feb 2015 04:24:35 -0800 (PST) X-Received: by 10.112.219.135 with SMTP id po7mr13909305lbc.111.1424780675693; Tue, 24 Feb 2015 04:24:35 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id zo8sm649738lbc.37.2015.02.24.04.24.34 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Feb 2015 04:24:34 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 24 Feb 2015 15:24:06 +0300 Message-Id: <1424780647-10250-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [PATCH 1/2] linux-generic: make more readable debug messages X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Pkio tests also test for incorrect number. In log there are messages about errors on ioctl. Make prints for that errors more clean. Like: odp_packet_socket.c:161:setup_pkt_sock():ioctl(SIOCGIFINDEX): No such device: "nothere". odp_packet_socket.c:738:mmap_store_hw_addr():ioctl(SIOCGIFHWADDR): No such device: "nothere" Signed-off-by: Maxim Uvarov --- platform/linux-generic/odp_packet_socket.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index 41e57c1..55c212e 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -157,7 +157,8 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, const char *netdev, snprintf(ethreq.ifr_name, IFNAMSIZ, "%s", netdev); err = ioctl(sockfd, SIOCGIFINDEX, ðreq); if (err != 0) { - ODP_ERR("ioctl(SIOCGIFINDEX): %s\n", strerror(errno)); + ODP_ERR("ioctl(SIOCGIFINDEX): %s: \"%s\".\n", strerror(errno), + ethreq.ifr_name); goto error; } if_idx = ethreq.ifr_ifindex; @@ -732,7 +733,9 @@ static int mmap_store_hw_addr(pkt_sock_mmap_t *const pkt_sock, ret = ioctl(pkt_sock->sockfd, SIOCGIFHWADDR, ðreq); if (ret != 0) { __odp_errno = errno; - ODP_ERR("ioctl(SIOCGIFHWADDR): %s\n", strerror(errno)); + ODP_ERR("ioctl(SIOCGIFHWADDR): %s: \"%s\".\n", + strerror(errno), + ethreq.ifr_name); return -1; }