From patchwork Fri Apr 29 23:56:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Llamas X-Patchwork-Id: 12833004 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7252BC433F5 for ; Fri, 29 Apr 2022 23:57:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381903AbiD3AAY (ORCPT ); Fri, 29 Apr 2022 20:00:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381888AbiD3AAX (ORCPT ); Fri, 29 Apr 2022 20:00:23 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BDB23C495 for ; Fri, 29 Apr 2022 16:56:54 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id q91-20020a17090a756400b001d951f4846cso7576770pjk.8 for ; Fri, 29 Apr 2022 16:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=xFhTGH9QeJ5qiB/zXRnDTivkTaz87eqIQdVVal+AQIE=; b=jsTFJVAZ4rGCpZ4ReIt8zBt6uWxZBtjqmkI/o/IJC9aS5dGeOFyznv/dB2oUdWWTEx htv3+XKz3FWRL5ut86hgRwU+3xBqQI/LSj0kcYgZ+hSwTkxrmBJ7cSOsar3iBwmcGGmM vgjqOkvrqOYb+zcWQwfxyMZI8OkfXRBqmS4cKRdN7EcmOw+HEaO+sz+Pm5H0BWj8uFp2 +qNwoB+xwjEjqcH7WS1eZLzijKiEEbBiMkK7NKvNnbqjy+++1kA/sgYAedlCcRMTuyvR qV+zG6n79jP6ZjxTGZoM2uk5cs0E/dujv6nH0wo3qmTaFVL9YBytG81ZTK/QBFdmxS+0 R7PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=xFhTGH9QeJ5qiB/zXRnDTivkTaz87eqIQdVVal+AQIE=; b=kJw03lj5S3DUeA9GEXo7BYYXdmDAOp/OOaXml9WzR1nnyLmdlazpNTcJUa7PwcVNNH P931BJLmPVSyvOU/9IjQ2UXGYsuDflS8DOV4HiUN99tQM3M3HMCzXYZl02UgUMDMQR5r HrIwy9i0SnKGhlF3fMpU/OS3YiAlL9aRbTdT7waZeDTdLUT4zmtVttPLf6dpqrELs6cI 3B73ibe3WwYZyMVyH0yn5FurwPnfX7HJhQ7HmDvQ+AOZwr2n/LUcm/6l+amZMcFsh11E UlIwN9vzRTivnwv8q9j0sFx6weBhl/G8ERTLLvCnysWtrBPLyKH89RUppLeTyZZat4Mk 4aUw== X-Gm-Message-State: AOAM530AlCaf+5xO1G8EgUERJnWPU8lZPf+CTnqt2hw302LDXUK7L+wN dUWEFMUJPoQtzN0/3fOY1OHcWnE58i7Axg== X-Google-Smtp-Source: ABdhPJxryxQ/W5f0mnRCA3VXeYsHPAOW3KmhV77eCRQVRyQ7xJ2vWAUFMEAVfxyiYM+pYR8BJB0aKpps/mGfzw== X-Received: from zllamas.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:4c]) (user=cmllamas job=sendgmr) by 2002:a17:902:f70a:b0:153:88c7:774 with SMTP id h10-20020a170902f70a00b0015388c70774mr1440396plo.166.1651276613804; Fri, 29 Apr 2022 16:56:53 -0700 (PDT) Date: Fri, 29 Apr 2022 23:56:40 +0000 In-Reply-To: <20220429235644.697372-1-cmllamas@google.com> Message-Id: <20220429235644.697372-2-cmllamas@google.com> Mime-Version: 1.0 References: <20220429235644.697372-1-cmllamas@google.com> X-Mailer: git-send-email 2.36.0.464.gb9c8b46e94-goog Subject: [PATCH v2 1/5] binder: add failed transaction logging info From: Carlos Llamas To: Greg Kroah-Hartman , " =?utf-8?q?Arve_Hj?= =?utf-8?q?=C3=B8nnev=C3=A5g?= " , Todd Kjos , Martijn Coenen , Christian Brauner , Suren Baghdasaryan Cc: Joel Fernandes , Hridya Valsaraju , kernel-team@android.com, linux-kernel@vger.kernel.org, Shuah Khan , Arnd Bergmann , Li Li , Masahiro Yamada , Carlos Llamas , linux-kselftest@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Make sure we log relevant information about failed transactions such as the target proc/thread, call type and transaction id. These details are particularly important when debugging userspace issues. Signed-off-by: Carlos Llamas Acked-by: Todd Kjos Acked-by: Christian Brauner (Microsoft) --- drivers/android/binder.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 8351c5638880..f0885baa53a1 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -3459,8 +3459,12 @@ static void binder_transaction(struct binder_proc *proc, } binder_debug(BINDER_DEBUG_FAILED_TRANSACTION, - "%d:%d transaction failed %d/%d, size %lld-%lld line %d\n", - proc->pid, thread->pid, return_error, return_error_param, + "%d:%d transaction %s to %d:%d failed %d/%d/%d, size %lld-%lld line %d\n", + proc->pid, thread->pid, reply ? "reply" : + (tr->flags & TF_ONE_WAY ? "async" : "call"), + target_proc ? target_proc->pid : 0, + target_thread ? target_thread->pid : 0, + t_debug_id, return_error, return_error_param, (u64)tr->data_size, (u64)tr->offsets_size, return_error_line);