From patchwork Sun Mar 24 05:06:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1915268 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=TUWA1PhG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=linux-cifs+bounces-1548-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V2PF90c66z1yWy for ; Sun, 24 Mar 2024 16:07:08 +1100 (AEDT) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0A36E281E6D for ; Sun, 24 Mar 2024 05:07:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DA1A29AB; Sun, 24 Mar 2024 05:07:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TUWA1PhG" X-Original-To: linux-cifs@vger.kernel.org Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B3681A38DE for ; Sun, 24 Mar 2024 05:07:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711256824; cv=none; b=FAd3iH5cAZGvEtL748wIDebudSDGMv/iEHyJfUTi9UFgq/RkwTIqLk9jxxrpHFcBGVHfAmLsXR4OmysQ8JBiJOPg2jJ5Ufaicj0zjaMnt9L8E8d7h0SBPPwgbGyhva9iTPKNLgZk2xk37ze2WNyl6/YHSNEVr/Ba8SLCaezZAvI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711256824; c=relaxed/simple; bh=ncV0v/GBgCE1cXW8ubWdMNaflE8Tslwj0jY6Rx+cNu8=; h=MIME-Version:From:Date:Message-ID:Subject:To:Cc:Content-Type; b=r/QrAzNUBivTx74mzSwhOoGnZOvP0EaS6nU2gaGFZiKYFCmOhnvLvpMRswBnqvrgAzilcvPpWpj4QRnLEPSmtGHx57G7V85h5gP5j5GTV/A760J29cOd66q9TgrIZykAVAAlrRtkn1mNWvejEU51SvVchJOUcZAUn1mFRyQKoIQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TUWA1PhG; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-51381021af1so5246580e87.0 for ; Sat, 23 Mar 2024 22:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711256820; x=1711861620; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=kcQ7aqapAzWh9V2jYgjZvNL++i4wCg6TaQgakyEunLo=; b=TUWA1PhGt3E/xUkhZzJnYVARHSoUYQzLUSvDgJMxpg5EmIbHbdbLCF5I5YmXxq9Ld1 ZRIH6Va+YQZIj5TIbS5p684yrHx2ImpljPq93h0havdn5wNgbyuO86wuZVRjMGVCPJRW Mn6dZJKAGFycOVnVWP90dvbZj6OhJDkt8E4xKs8JZnr7RgzaiBablsG+/yilnzIQKknC cYM2JbLN8UrHKdE/+SZaOz8gxWO72fP6cpU3UAw1dal7gO/WI0/lKPP0bym5OzrFIO0q w0eIuDbDZq4rBM8Te4zMnE4kGqS+wnWNSnzltOqO/amJj1fq8MCN/DIvhx0Jf3a3vpfR pQWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711256820; x=1711861620; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kcQ7aqapAzWh9V2jYgjZvNL++i4wCg6TaQgakyEunLo=; b=FRlWPSP7qf9trkHgJiByWVoSUJmLG8Cvj3xAP3rsg7RK7TTAxrvkrcmTlm0adORfFG YY7qonmRYjkKXB1owCrZhLL+/W5uSDS3WL9e3U/OdukNEQUGFsQiIgtq/0BVIq37aFcX CeVav8LKjgGkeEjRrXQEd7s6mxOjs8rHYdgk5I351RlesOAxIcd0rjWcmA3/iNqATZIg so984/oVd3UbwSsvvCGyLIMMLDfYl+XGgHqKAjxe/fYDbO/yOtRQ7bB0pXe/5mId8xBE yVj1U1NVZF8uMWgQVNxZbUtbyYlKWQsOYiqE4tNUdho5SkD39TQ5D3iw4B/+TF6c63wE xRlg== X-Gm-Message-State: AOJu0YyORfS8dxrul7upsF6PmHFVkZI+AHb9qqj2KsoyD6+EIX1CFjgW haeAYpQ+Oe/+DHFgPfPq0n4x/CioEdMxT0gqDT0zXisL3LWYr42h45Z5fz2FHPnLIsCKdYzAPe3 bV6dWJ0cjvxFSfEfFaP2mzibB1VPYP8rY4+Q= X-Google-Smtp-Source: AGHT+IEjiRV5XamzppIO6hae9gz9OzZSCuvxxDzciOqIO3plgnEYfQJ8Z1a7g7B/mvxwm+w4orKTmCSUKzZgcjakZUU= X-Received: by 2002:a05:6512:715:b0:513:2f96:72b5 with SMTP id b21-20020a056512071500b005132f9672b5mr2482250lfs.33.1711256820226; Sat, 23 Mar 2024 22:07:00 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Steve French Date: Sun, 24 Mar 2024 00:06:49 -0500 Message-ID: Subject: [PATCH][SMB3 client] add trace event for mknod To: CIFS Cc: samba-technical , Paulo Alcantara See attached Add trace points to help debug mknod and mkfifo: smb3_mknod_done smb3_mknod_enter smb3_mknod_err Example output: TASK-PID CPU# ||||| TIMESTAMP FUNCTION | | | ||||| | | mkfifo-6163 [003] ..... 960.425558: smb3_mknod_enter: xid=12 sid=0xb55130f6 tid=0x46e6241c path=\fifo1 mkfifo-6163 [003] ..... 960.432719: smb3_mknod_done: xid=12 sid=0xb55130f6 tid=0x46e6241c From bda0b06c0263d4d42989124826751d9e7fa82978 Mon Sep 17 00:00:00 2001 From: Steve French Date: Sun, 24 Mar 2024 00:01:02 -0500 Subject: [PATCH] smb3: add trace event for mknod Add trace points to help debug mknod and mkfifo: smb3_mknod_done smb3_mknod_enter smb3_mknod_err Example output: TASK-PID CPU# ||||| TIMESTAMP FUNCTION | | | ||||| | | mkfifo-6163 [003] ..... 960.425558: smb3_mknod_enter: xid=12 sid=0xb55130f6 tid=0x46e6241c path=\fifo1 mkfifo-6163 [003] ..... 960.432719: smb3_mknod_done: xid=12 sid=0xb55130f6 tid=0x46e6241c Signed-off-by: Steve French --- fs/smb/client/dir.c | 7 +++++++ fs/smb/client/trace.h | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c index 89333d9bce36..d11dc3aa458b 100644 --- a/fs/smb/client/dir.c +++ b/fs/smb/client/dir.c @@ -612,11 +612,18 @@ int cifs_mknod(struct mnt_idmap *idmap, struct inode *inode, goto mknod_out; } + trace_smb3_mknod_enter(xid, tcon->ses->Suid, tcon->tid, full_path); + rc = tcon->ses->server->ops->make_node(xid, inode, direntry, tcon, full_path, mode, device_number); mknod_out: + if (rc) + trace_smb3_mknod_err(xid, tcon->ses->Suid, tcon->tid, rc); + else + trace_smb3_mknod_done(xid, tcon->ses->Suid, tcon->tid); + free_dentry_path(page); free_xid(xid); cifs_put_tlink(tlink); diff --git a/fs/smb/client/trace.h b/fs/smb/client/trace.h index f9c1fd32d0b8..5e83cb9da902 100644 --- a/fs/smb/client/trace.h +++ b/fs/smb/client/trace.h @@ -375,6 +375,7 @@ DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(get_reparse_compound_enter); DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(delete_enter); DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mkdir_enter); DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(tdis_enter); +DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mknod_enter); DECLARE_EVENT_CLASS(smb3_inf_compound_done_class, TP_PROTO(unsigned int xid, @@ -415,7 +416,7 @@ DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(query_wsl_ea_compound_done); DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(delete_done); DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mkdir_done); DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(tdis_done); - +DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mknod_done); DECLARE_EVENT_CLASS(smb3_inf_compound_err_class, TP_PROTO(unsigned int xid, @@ -461,6 +462,7 @@ DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(query_wsl_ea_compound_err); DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mkdir_err); DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(delete_err); DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(tdis_err); +DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mknod_err); /* * For logging SMB3 Status code and Command for responses which return errors -- 2.40.1