Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp129428ybt; Thu, 25 Jun 2020 17:15:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1W6O9oBLHNLBBPSvVLXlqfnBdJjK5eZKHkqlL9ACStYnpR7wcn5NLHTCvAPSZ098NU+Vs X-Received: by 2002:aa7:c245:: with SMTP id y5mr791035edo.189.1593130531448; Thu, 25 Jun 2020 17:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593130531; cv=none; d=google.com; s=arc-20160816; b=DEM0pqKwy4spN1Ortp2KGEp4DggWryeEOcryzWG0X12WinS5MyvOuSI1KJvcBRoAwA baXQSfO0B4QJ5+x2alf9JIvkbsQV54HPNePCjW6ifQCBPZd++OkHK1w8QKi2cPHx0Gaa +bHJZTC23na6H7xzqOAVMotilcSbAtptNRMwJVd7vd5vYM3tLvvNPl5qx/azAudOpZ+Z RkVbxuxVEozq+DZJ0OXxL4sEb90/ntIi+OmQB5ekE/2U6kkSTqhyClNRXpIhodvgf5vE 1W2fteAsSWroYOmNftk65QkD+LbNLGVE5COT/JRJ7O20ghvxL3Zus8cGd2EIVJ97abww C05A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:smtp-origin-cluster :cc:to:smtp-origin-hostname:from:smtp-origin-hostprefix :dkim-signature; bh=3ONjp7CWOSdFHihdfBb7maRuGkiLLNmD1ygd6LZZmLQ=; b=WSo24bt/jjHO5iLBq7z+R3mbVUaQ8jXRjvprzGxugr5cB5PDdF3CUdICdDs4TzN50e sOWG15KC4yna/9vlhDEV4Hoy7QwFZ50Dn61yOlXOyGd4O+YwJizA9Dih5fSpTaxqY9Lz SspAELW1Es8yVHRWNyN7SkVqqvUdFzFeXwxO0Gxz2mkz7sGa2QkHu0Il+qF30fHKA9uw bGf/t8+/s4ONSozt0WdOTOr625UmJpKBSbq1P4hKkMsui787ccWMYqLcPDT2urhU5hmD wOebmzKfCy4OY4pWfGeBaGXSW60Ibv/hRYlsOjUfj/n/m8sRY9nj7d8LvdzyOwPBFyPu l7YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=NB2DGrco; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn17si21563057ejc.556.2020.06.25.17.15.08; Thu, 25 Jun 2020 17:15:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=NB2DGrco; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726362AbgFZAOH (ORCPT + 99 others); Thu, 25 Jun 2020 20:14:07 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:5952 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725833AbgFZANx (ORCPT ); Thu, 25 Jun 2020 20:13:53 -0400 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.42/8.16.0.42) with SMTP id 05Q09lki028169 for ; Thu, 25 Jun 2020 17:13:52 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=3ONjp7CWOSdFHihdfBb7maRuGkiLLNmD1ygd6LZZmLQ=; b=NB2DGrcoziBum2zvrT0a+J8ujl28JYJ8u1KydUH29yUHOVniCiopB16vriMcEkb4i7GT swISqSGSdPJAtW+kmXhN2wMPid5j9IxHmSZ1EfFE3Vjb+ImrY0rtTtrlEpvPpbWH48E7 zzs/Ai9r6p5ZJRTZqVrtf5MJobEmPyPrMwQ= Received: from mail.thefacebook.com ([163.114.132.120]) by m0089730.ppops.net with ESMTP id 31ux0nttyc-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 25 Jun 2020 17:13:52 -0700 Received: from intmgw003.08.frc2.facebook.com (2620:10d:c085:208::f) by mail.thefacebook.com (2620:10d:c085:21d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 25 Jun 2020 17:13:50 -0700 Received: by devbig006.ftw2.facebook.com (Postfix, from userid 4523) id 4DC8F62E4FA9; Thu, 25 Jun 2020 17:13:42 -0700 (PDT) Smtp-Origin-Hostprefix: devbig From: Song Liu Smtp-Origin-Hostname: devbig006.ftw2.facebook.com To: , , CC: , , , , , , Song Liu Smtp-Origin-Cluster: ftw2c04 Subject: [PATCH v2 bpf-next 1/4] perf: export get/put_chain_entry() Date: Thu, 25 Jun 2020 17:13:29 -0700 Message-ID: <20200626001332.1554603-2-songliubraving@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200626001332.1554603-1-songliubraving@fb.com> References: <20200626001332.1554603-1-songliubraving@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-06-25_19:2020-06-25,2020-06-25 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 mlxscore=0 lowpriorityscore=0 cotscore=-2147483648 spamscore=0 suspectscore=8 adultscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 clxscore=1015 malwarescore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006250142 X-FB-Internal: deliver Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This would be used by bpf stack mapo. Signed-off-by: Song Liu --- include/linux/perf_event.h | 2 ++ kernel/events/callchain.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index b4bb32082342c..00ab5efa38334 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -1244,6 +1244,8 @@ get_perf_callchain(struct pt_regs *regs, u32 init_n= r, bool kernel, bool user, extern struct perf_callchain_entry *perf_callchain(struct perf_event *ev= ent, struct pt_regs *regs); extern int get_callchain_buffers(int max_stack); extern void put_callchain_buffers(void); +extern struct perf_callchain_entry *get_callchain_entry(int *rctx); +extern void put_callchain_entry(int rctx); =20 extern int sysctl_perf_event_max_stack; extern int sysctl_perf_event_max_contexts_per_stack; diff --git a/kernel/events/callchain.c b/kernel/events/callchain.c index 334d48b16c36d..50b8a1622807f 100644 --- a/kernel/events/callchain.c +++ b/kernel/events/callchain.c @@ -149,7 +149,7 @@ void put_callchain_buffers(void) } } =20 -static struct perf_callchain_entry *get_callchain_entry(int *rctx) +struct perf_callchain_entry *get_callchain_entry(int *rctx) { int cpu; struct callchain_cpus_entries *entries; @@ -168,7 +168,7 @@ static struct perf_callchain_entry *get_callchain_ent= ry(int *rctx) (*rctx * perf_callchain_entry__sizeof())); } =20 -static void +void put_callchain_entry(int rctx) { put_recursion_context(this_cpu_ptr(callchain_recursion), rctx); --=20 2.24.1