From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD174C3DA59 for ; Fri, 19 Jul 2024 16:54:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADCF510EC66; Fri, 19 Jul 2024 16:54:42 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="nPhjnebz"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id C3AF210EC66 for ; Fri, 19 Jul 2024 16:54:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721408082; x=1752944082; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=JYwQE/6RXVA/s6DfbLVU33QwEauZwB1z7KQQSnHofkc=; b=nPhjnebzMdB0vshYaI+wCiIFMByjX7B44UhfHWdiPjStZ1eEBbiYIiYQ eZv984GNM1QsgdLI55DGX7M2CJu5eT8RfsCztP0cjrffzqSCGXLhLy0si GFoaA5AdMlUNFAw+JppqFe8pGeiip8QeedJVMHcx9iZ6pGz6QES7fvWDc 90bERkwwjFfEObFillJBvDQVogzPqMB/g7H+Jfb6gfslJ0nait4mdnY9Q 1z11WciGiOfQgswbCvnUu/a/4wTVm+tilrWHDVRcCMzm4ZcVRdUm2It0J 9AUL4+G+1PjibcyOJPfpgiWGR6hzd72DpKfIarqDL9Htl9y7uHS+5Wg/5 A==; X-CSE-ConnectionGUID: FoxIOWs0S2+RAopUGobI/g== X-CSE-MsgGUID: 1sTXUeYqS7mN9KWMz17iVA== X-IronPort-AV: E=McAfee;i="6700,10204,11138"; a="41557078" X-IronPort-AV: E=Sophos;i="6.09,221,1716274800"; d="scan'208";a="41557078" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2024 09:54:41 -0700 X-CSE-ConnectionGUID: OZeTi3VfQvyPIMmzXCVKJg== X-CSE-MsgGUID: XHoNFfE1SpWYu2TcS+cTJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,221,1716274800"; d="scan'208";a="50912888" Received: from calebbar-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.125.49.33]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2024 09:54:41 -0700 Date: Fri, 19 Jul 2024 09:50:04 -0700 Message-ID: <871q3p5nsz.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Joonas Lahtinen , Rodrigo Vivi , Lucas De Marchi Cc: intel-xe@lists.freedesktop.org, Umesh Nerlige Ramappa , Jose Souza Subject: When sysfs is not available (say containers) In-Reply-To: <20240618014609.3233427-6-ashutosh.dixit@intel.com> References: <20240618014609.3233427-1-ashutosh.dixit@intel.com> <20240618014609.3233427-6-ashutosh.dixit@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Mon, 17 Jun 2024 18:45:57 -0700, Ashutosh Dixit wrote: > Folks, The below is just an example from one of the earlier OA patches (already merged): > [PATCH 05/17] drm/xe/oa/uapi: Add/remove OA config perf ops > > +static ssize_t show_dynamic_id(struct kobject *kobj, > + struct kobj_attribute *attr, > + char *buf) > +{ > + struct xe_oa_config *oa_config = > + container_of(attr, typeof(*oa_config), sysfs_metric_id); > + > + return sysfs_emit(buf, "%d\n", oa_config->id); > +} > + > +static int create_dynamic_oa_sysfs_entry(struct xe_oa *oa, > + struct xe_oa_config *oa_config) > +{ > + sysfs_attr_init(&oa_config->sysfs_metric_id.attr); > + oa_config->sysfs_metric_id.attr.name = "id"; > + oa_config->sysfs_metric_id.attr.mode = 0444; > + oa_config->sysfs_metric_id.show = show_dynamic_id; > + oa_config->sysfs_metric_id.store = NULL; > + > + oa_config->attrs[0] = &oa_config->sysfs_metric_id.attr; > + oa_config->attrs[1] = NULL; > + > + oa_config->sysfs_metric.name = oa_config->uuid; > + oa_config->sysfs_metric.attrs = oa_config->attrs; > + > + return sysfs_create_group(oa->metrics_kobj, &oa_config->sysfs_metric); > +} So we often expose things in sysfs. The question is: are there general guidelines for what to do for environments (such as containers) where userspace cannot access sysfs? E.g. in such cases, do we expose the information exposed in sysfs via queries (i.e. an ioctl)? Or another way? What have we done in the past in drm and what should we do in these cases for Xe? Thanks. -- Ashutosh