lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM6PR04MB6575197B8626D3F91C9231C4FCCE0@DM6PR04MB6575.namprd04.prod.outlook.com>
Date:   Mon, 7 Dec 2020 07:57:27 +0000
From:   Avri Altman <Avri.Altman@....com>
To:     Bean Huo <huobean@...il.com>,
        "alim.akhtar@...sung.com" <alim.akhtar@...sung.com>,
        "asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
        "jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "stanley.chu@...iatek.com" <stanley.chu@...iatek.com>,
        "beanhuo@...ron.com" <beanhuo@...ron.com>,
        "bvanassche@....org" <bvanassche@....org>,
        "tomas.winkler@...el.com" <tomas.winkler@...el.com>,
        "cang@...eaurora.org" <cang@...eaurora.org>
CC:     "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>
Subject: RE: [PATCH v1 3/3] scsi: ufs: Make UPIU trace easier differentiate
 among CDB, OSF, and TM

> 
> 
> From: Bean Huo <beanhuo@...ron.com>
> 
> Transaction Specific Fields (TSF) in the UPIU package could be CDB
> (SCSI/UFS Command Descriptor Block), OSF (Opcode Specific Field), and
> TM I/O parameter (Task Management Input/Output Parameter). But,
> currently,
> we take all of these as CDB  in the UPIU trace. Thus makes user confuse
> among CDB, OSF, and TM message. So fix it with this patch.
> 
> Signed-off-by: Bean Huo <beanhuo@...ron.com>
> ---
>  drivers/scsi/ufs/ufshcd.c  |  9 +++++----
>  include/trace/events/ufs.h | 10 +++++++---
>  2 files changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 29d7240a61bf..5b2219e44743 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -315,7 +315,8 @@ static void ufshcd_add_cmd_upiu_trace(struct
> ufs_hba *hba, unsigned int tag,
>  {
>         struct utp_upiu_req *rq = hba->lrb[tag].ucd_req_ptr;
> 
> -       trace_ufshcd_upiu(dev_name(hba->dev), str, &rq->header, &rq-
> >sc.cdb);
> +       trace_ufshcd_upiu(dev_name(hba->dev), str, &rq->header, &rq-
> >sc.cdb,
> +                         "CDB");
>  }
> 
>  static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba, unsigned int
> tag,
> @@ -329,7 +330,7 @@ static void ufshcd_add_query_upiu_trace(struct
> ufs_hba *hba, unsigned int tag,
>                 rq_rsp = (struct utp_upiu_req *)hba->lrb[tag].ucd_rsp_ptr;
> 
>         trace_ufshcd_upiu(dev_name(hba->dev), str, &rq_rsp->header,
> -                         &rq_rsp->qr);
> +                         &rq_rsp->qr, "OSF");
>  }
> 
>  static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int
> tag,
> @@ -340,10 +341,10 @@ static void ufshcd_add_tm_upiu_trace(struct
> ufs_hba *hba, unsigned int tag,
> 
>         if (!strcmp("tm_send", str))
>                 trace_ufshcd_upiu(dev_name(hba->dev), str, &descp->req_header,
> -                                 &descp->input_param1);
> +                                 &descp->input_param1, "TM_INPUT");
>         else
>                 trace_ufshcd_upiu(dev_name(hba->dev), str, &descp->rsp_header,
> -                                 &descp->output_param1);
> +                                 &descp->output_param1, "TM_OUTPUT");
>  }
> 
>  static void ufshcd_add_uic_command_trace(struct ufs_hba *hba,
> diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h
> index 0bd54a184391..68e8e97a9b47 100644
> --- a/include/trace/events/ufs.h
> +++ b/include/trace/events/ufs.h
> @@ -295,15 +295,17 @@ TRACE_EVENT(ufshcd_uic_command,
>  );
> 
>  TRACE_EVENT(ufshcd_upiu,
> -       TP_PROTO(const char *dev_name, const char *str, void *hdr, void *tsf),
> +       TP_PROTO(const char *dev_name, const char *str, void *hdr, void *tsf,
> +                const char *tsf_type),
> 
> -       TP_ARGS(dev_name, str, hdr, tsf),
> +       TP_ARGS(dev_name, str, hdr, tsf, tsf_type),
> 
>         TP_STRUCT__entry(
>                 __string(dev_name, dev_name)
>                 __string(str, str)
>                 __array(unsigned char, hdr, 12)
>                 __array(unsigned char, tsf, 16)
> +               __string(tsf_type, tsf_type)
>         ),
> 
>         TP_fast_assign(
> @@ -311,12 +313,14 @@ TRACE_EVENT(ufshcd_upiu,
>                 __assign_str(str, str);
>                 memcpy(__entry->hdr, hdr, sizeof(__entry->hdr));
>                 memcpy(__entry->tsf, tsf, sizeof(__entry->tsf));
> +               __assign_str(tsf_type, tsf_type);
>         ),
> 
>         TP_printk(
> -               "%s: %s: HDR:%s, CDB:%s",
> +               "%s: %s: HDR:%s, %s:%s",
>                 __get_str(str), __get_str(dev_name),
>                 __print_hex(__entry->hdr, sizeof(__entry->hdr)),
> +               __get_str(tsf_type),
This breaks what current parsers expects.
Why str is not enough to distinguish between the command?

Thanks,
Avri

>                 __print_hex(__entry->tsf, sizeof(__entry->tsf))
>         )
>  );
> --
> 2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ