Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3274318ybt; Mon, 29 Jun 2020 21:19:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJye6N6txVbcHxYddnjZnCXzkTFyowrdztt6NoZLbzSJnTftQoNW4wUHSxrKI9ycHMast/KZ X-Received: by 2002:a17:906:5006:: with SMTP id s6mr16274808ejj.294.1593490757277; Mon, 29 Jun 2020 21:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593490757; cv=none; d=google.com; s=arc-20160816; b=fk4y0sML3ztIVBLb374UZy7pOEn2N/8vF7dIsy4RyPz9Mq/cu88rkm3Fjsf8PG52z7 mzqz9QJ4smOx7mWXt2eHgc5IaXJldnGXfg7RGcXaJ/pDyzKl6DEju7npNhkcSTzQkd9D A2w/9/yB5t0Hj2ILThFcnLm67eqjH7BH7hn5DD0IrhuSH76IagL1g1UVSjFG5Tdvrpmk y7N8Qo/wOmM652AqAE60uBqK4xUcd4m/lIoP2ApSG3eRc5mQoFAuUVR9FFI6I7klP7VI XLoIHZiOz9sCmPStF7AeYKxlnlzJcv51O+5f1EJLH7ps+j9aE0uLk/B3N6Ixy3VIxGnA EcRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fIcivcJQm44ONQGpWrUS/jOeJybp0T780H6n/rm2fZc=; b=uAfPMEewFwUJEdu4g2AJ7zN42ocyO3zla5UuqXDoCAqj7sfu68SV7Ycpd7q4XOeUFQ DMmqnaTHmryu6JYRdEo/Wa78I4UnrWrOLHl4Mwua1DUp0juzK7BMGs0Msw4SEGxXJFMg /3T8vvfL03PhLpag885ALC175qNJCR7wn8voe8pMvF7xcO8LZHJtwJbvusGXNXIJPA9I Gi7KV9Ki4LnOO9y/HmGRk+9LvbKmxnrH/kXdkESEHFQ0JYJ2WjTbYHtQCItQbQGhIcZv yW61YdkRQmdzFFt2K4BlHMja7e4cukjF+Tot8dRA3ytUzwXxGapZuclpXf8A2KB8pufO W0oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N19+uZB4; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lm17si902666ejb.366.2020.06.29.21.18.53; Mon, 29 Jun 2020 21:19:17 -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=@gmail.com header.s=20161025 header.b=N19+uZB4; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726283AbgF3ESs (ORCPT + 99 others); Tue, 30 Jun 2020 00:18:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbgF3ESr (ORCPT ); Tue, 30 Jun 2020 00:18:47 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6236DC061755; Mon, 29 Jun 2020 21:18:47 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id h22so13666733lji.9; Mon, 29 Jun 2020 21:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fIcivcJQm44ONQGpWrUS/jOeJybp0T780H6n/rm2fZc=; b=N19+uZB48xp0cwgT5xnjyce4SK6Ic2JBWjaCBUGZ+HB1erClgyvCRQQGME8Erdnjq5 P8m3Tha1AEs6GY4r3KNqG+5LVDeDeuYZBCEFDGN7rmuf1YRXsRn6jDr4+lrzvg66OCe/ wxkdH9jex/voPd3e7Cg6aLrmR76QdQsR10xQlZO9B2n82zQ4a0IB2jkQWqGKhTd1x9Ii liluWW6XIqYwyFOOQli0PAB2EB3t/DvpZOf/6Bh5pCnJc/57aqwhBWszHkk+KfUMuZta vQ7v5qF3P7u+tU33w1Y2XLFgm1tjkyZwJnrQYABmFSD2sAG2IvNnfiDlrC45Hw2gC27c 3Dqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fIcivcJQm44ONQGpWrUS/jOeJybp0T780H6n/rm2fZc=; b=ESJwZgunABf5JARIMQqNrajKIBQemGzdKgN291UQIWH7EcgUfc9fqTwdZd/ZxVLR+P vK6zNmu9epd0YsRy+AtukguAl1NSEaV7QgcRGMclTJWjTuKQulC/kp/Jo2Ia6pZ3r1HY jEbRwnYVqmnrQ5G+JZawWmYDi01sankkvL5DwwpOr7mzLF2+rzBW7zzIZETvdDYRhNkN AKPpxNidfWndZVmwttxlQ2S6ccsIYweI0ag8+JzW1KfUuCV1LzTSXe4IMAoo36fM2/+Z jtVGUV3KTPOwUUHaBDx9/jFxC7GOcP+WYlSO4ye/NOMyxIk+evx27u03AovtU/Y9FuVy bJYg== X-Gm-Message-State: AOAM530dUlYIBO5uq9pNqlf6uHS1rBjtfCX+WyYv3LxFinbzqZDMMaVm RafyGmh1tJiqXuHOdRkYXv29ttTTCMwmITqP/322pFu/ X-Received: by 2002:a2e:8744:: with SMTP id q4mr9691671ljj.91.1593490724369; Mon, 29 Jun 2020 21:18:44 -0700 (PDT) MIME-Version: 1.0 References: <20200629055530.3244342-1-songliubraving@fb.com> <20200629055530.3244342-3-songliubraving@fb.com> In-Reply-To: <20200629055530.3244342-3-songliubraving@fb.com> From: Alexei Starovoitov Date: Mon, 29 Jun 2020 21:18:33 -0700 Message-ID: Subject: Re: [PATCH v4 bpf-next 2/4] bpf: introduce helper bpf_get_task_stack() To: Song Liu Cc: bpf , Network Development , LKML , Peter Zijlstra , Alexei Starovoitov , Daniel Borkmann , Kernel Team , John Fastabend , KP Singh , Andrii Nakryiko Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 28, 2020 at 10:58 PM Song Liu wrote: > > Introduce helper bpf_get_task_stack(), which dumps stack trace of given > task. This is different to bpf_get_stack(), which gets stack track of > current task. One potential use case of bpf_get_task_stack() is to call > it from bpf_iter__task and dump all /proc//stack to a seq_file. > > bpf_get_task_stack() uses stack_trace_save_tsk() instead of > get_perf_callchain() for kernel stack. The benefit of this choice is that > stack_trace_save_tsk() doesn't require changes in arch/. The downside of > using stack_trace_save_tsk() is that stack_trace_save_tsk() dumps the > stack trace to unsigned long array. For 32-bit systems, we need to > translate it to u64 array. > > Acked-by: Andrii Nakryiko > Signed-off-by: Song Liu It doesn't apply: Applying: bpf: Introduce helper bpf_get_task_stack() Using index info to reconstruct a base tree... error: patch failed: kernel/bpf/stackmap.c:471 error: kernel/bpf/stackmap.c: patch does not apply error: Did you hand edit your patch? It does not apply to blobs recorded in its index. Patch failed at 0002 bpf: Introduce helper bpf_get_task_stack()