From patchwork Thu Apr 19 01:34:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 133675 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp87997ljf; Wed, 18 Apr 2018 18:34:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx494EzMLY6LNDEF2mbuYePZ+WYkXDkd7y3Iw4BgIF3Qlb8MU9PNSdIt66tAMh0mMQq8g3q5+ X-Received: by 10.98.109.66 with SMTP id i63mr3952565pfc.233.1524101667380; Wed, 18 Apr 2018 18:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524101667; cv=none; d=google.com; s=arc-20160816; b=wc1KaGW6TqiGHkhYehLSd5lMh1NHhrtQE9HQWPDye6ckYYLZVe7BlFFtRxyA2pcq1U l3HFv65gwe01Td+NYnLQkTCGnlIga9XqqlQmQAZ9yw7QyUlB7Wn1KAbWlSozf0LWGd38 aTwceQwNjEavi07GssM05L45FPnSgyCvSVaBmN2z2VZf5s2AbZkCud8DWICGzXw1jC0K zY5rBuOFKHUiadhd3tOnwxdpo9CWX8G3bLmeyU6uh/OuhY18R0DccZkOYYaYYrDrb6S6 fM6VgkPObuwZVW02je3KnRUiU+SMpEyc+AVNISZgtO6PmweH2L7ACPmfNItzQVeXKCTv z/mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Xyn/yzEkWYseXSQRF/v+f+FTP1zfLrxyMCYuX8w+IuU=; b=HPEDKNamx40+3wM/IKewlRjwbbRwI5zS8m/WHreSRJW/tFdK54Rqzlgarl5oCNpofI B1rPNixIZ9oy2vk39pIxKKHEjAPKiedmcuD6ZrLTYkrnql0G2T2G2R9UF+FBx4c5a5ja oiL02xZShmFDjxDGvWI+bAL4599fdyIBin5SIx7JBJNYlqr6FhPfgfAlZwbEYYTTGk2b cnDiuotjkE6qFiZ5I9uHMa1D2fZrs3DSZxsWZNO1WRKOhol3AVr0HP6yrnn6SRSZKwZJ 6PWeLzGKjGaNUveSflZwEZGLm/qKWI7BEyTqOnmXF7xVI7qE6/P6eKxeilWnsf7+eYZV w8pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hD1oKNuD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4-v6si2470457plo.190.2018.04.18.18.34.27; Wed, 18 Apr 2018 18:34:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hD1oKNuD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752876AbeDSBeY (ORCPT + 29 others); Wed, 18 Apr 2018 21:34:24 -0400 Received: from mail-ot0-f194.google.com ([74.125.82.194]:33927 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752247AbeDSBeW (ORCPT ); Wed, 18 Apr 2018 21:34:22 -0400 Received: by mail-ot0-f194.google.com with SMTP id i5-v6so4126507oth.1 for ; Wed, 18 Apr 2018 18:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Xyn/yzEkWYseXSQRF/v+f+FTP1zfLrxyMCYuX8w+IuU=; b=hD1oKNuDKtsNZgY7vtXJ/VLSNTptnyMIK4kI+nt4g9jHxutj2Mw9itUWqjbCUTW/EN 8yjM6FjgFbfjgOWJvxV+z5Y1p6BREi2V7N1Q9YRsaD7TjXXgZNHjS4UruauvndE2BARD StuzmoaYIQeLTXAy8qgst9MHV34OqnkwHmA94= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Xyn/yzEkWYseXSQRF/v+f+FTP1zfLrxyMCYuX8w+IuU=; b=IJHVYaCJZblX3vFGNIXjupcfVapt0n+1KOz3+mUTdEDZtmgzuywXaH+aPPPgc6GaIG J7OCTpdYhJTZXE9yM8ksOU3x0rUM2JajvRSwu3Pp1NWS94gufyOymp44Q20LkzmtazNX +EJqSJApnTKG3zIXmyyWhqzQo0rRiULJHIGUAx4zYXQVUXPohimHCFdvvsvjtaziRJX3 fN3KP6JN1CK2df+qQQHmt4zV4ounKBbT9TOKIpD3oz2t3otIFD8Zr1Qb/OmT6Vf10KAN P6XvVnfYiz6IUMBUMOc4T6j6xJkdO0C87/Axh0VJ/6SwTVW28WlxvNh0IHLIre/Qqx3Y HZJg== X-Gm-Message-State: ALQs6tDVu/WGtYPPSz2DSK0+/12yMsY5r8jSCfNEGMF5RKMCMM/CXvkk BngDOiKOoTHwkzK1NQ3mIx4mww== X-Received: by 2002:a9d:383c:: with SMTP id i57-v6mr2958792otc.196.1524101661556; Wed, 18 Apr 2018 18:34:21 -0700 (PDT) Received: from localhost.localdomain (li973-238.members.linode.com. [45.33.19.238]) by smtp.gmail.com with ESMTPSA id m84-v6sm1389662oia.1.2018.04.18.18.34.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Apr 2018 18:34:20 -0700 (PDT) From: Leo Yan To: Alexei Starovoitov , Daniel Borkmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH bpf-next 0/5] samples/bpf: Minor fixes and cleanup Date: Thu, 19 Apr 2018 09:34:01 +0800 Message-Id: <1524101646-6544-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series is minor fixes and cleanup for bpf load and samples code. The first one patch is typo fixing; patch 0002 is refactor for dynamically allocate memory for kernel symbol structures; the last three patches are mainly related with refactor with function ksym_search(), the main benefit of this refactor is program sampleip can be used without architecture dependency. The patch series has been tested on ARM64 Hikey960 boards. Leo Yan (5): samples/bpf: Fix typo in comment samples/bpf: Dynamically allocate structure 'syms' samples/bpf: Use NULL for failed to find symbol samples/bpf: Refine printing symbol for sampleip samples/bpf: Handle NULL pointer returned by ksym_search() samples/bpf/bpf_load.c | 29 +++++++++++++++++++++++------ samples/bpf/offwaketime_user.c | 5 +++++ samples/bpf/sampleip_user.c | 8 +++----- samples/bpf/spintest_user.c | 5 ++++- samples/bpf/trace_event_user.c | 5 +++++ 5 files changed, 40 insertions(+), 12 deletions(-) -- 1.9.1