Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5038 Discussions

Cannot build Intel Sampling Drivers (error: passing argument 1 of ‘class_create’ ...)

AckoftOvak
Beginner
4,742 Views

VTune 2023.1.0
Manjaro 23.0.0
Linux 6.4.3
GCC 13.1.1

user@hostname:/opt/intel/oneapi/vtune/latest/sepdk/src
$ sudo ./build-driver

C compiler to use: [ /sbin/gcc ] 
C compiler version: 13.1.1

Make command to use: [ /sbin/make ] 
Make version: 4.4.1

Kernel source directory: [ /lib/modules/6.4.3-1-MANJARO/build ] 
Kernel version: 6.4.3-1-MANJARO

Cleaning workspaces ... 
Done

Building socperf driver ... 
In file included from ./include/linux/linkage.h:7,
                 from ./arch/x86/include/asm/cache.h:5,
                 from ./include/linux/cache.h:6,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:13,
                 from /opt/intel/oneapi/vtune/2023.1.0/sepdk/src/socperf/src/socperfdrv.c:61:
/opt/intel/oneapi/vtune/2023.1.0/sepdk/src/socperf/src/socperfdrv.c: In function ‘socperf_Load’:
./include/linux/export.h:27:22: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   27 | #define THIS_MODULE (&__this_module)
      |                     ~^~~~~~~~~~~~~~~
      |                      |
      |                      struct module *
/opt/intel/oneapi/vtune/2023.1.0/sepdk/src/socperf/src/socperfdrv.c:1738:34: note: in expansion of macro ‘THIS_MODULE’
 1738 |         pmu_class = class_create(THIS_MODULE, SOCPERF_DRIVER_NAME);
      |                                  ^~~~~~~~~~~
In file included from ./include/linux/device.h:31,
                 from ./include/linux/cdev.h:8,
                 from /opt/intel/oneapi/vtune/2023.1.0/sepdk/src/socperf/src/socperfdrv.c:69:
./include/linux/device/class.h:230:54: note: expected ‘const char *’ but argument is of type ‘struct module *’
  230 | struct class * __must_check class_create(const char *name);
      |                                          ~~~~~~~~~~~~^~~~
/opt/intel/oneapi/vtune/2023.1.0/sepdk/src/socperf/src/socperfdrv.c:1738:21: error: too many arguments to function ‘class_create’
 1738 |         pmu_class = class_create(THIS_MODULE, SOCPERF_DRIVER_NAME);
      |                     ^~~~~~~~~~~~
./include/linux/device/class.h:230:29: note: declared here
  230 | struct class * __must_check class_create(const char *name);
      |                             ^~~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:252: /opt/intel/oneapi/vtune/2023.1.0/sepdk/src/socperf/src/socperfdrv.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:2026: /opt/intel/oneapi/vtune/2023.1.0/sepdk/src/socperf/src] Error 2
make[1]: *** [Makefile:145: default] Error 2
make: *** [Makefile:210: default] Error 2

Failed to build the drivers

 

 

0 Kudos
9 Replies
AthiraM_Intel
Moderator
4,704 Views

Hi,

 

Thank you for posting in Intel Communities.

 

The issue may be because you are using an unsupported platform. Could you please refer the system requirements and try to use any supported OS.

 

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/vtune-profiler-system-requirements.html

 

 If you have any further issue, please let us know.



Thanks


0 Kudos
AckoftOvak
Beginner
4,606 Views

I am so happy with this answer. Great job! Thank you so much for your help! I always knew I can rely on Intel. You are the best, guys.

0 Kudos
AthiraM_Intel
Moderator
4,557 Views

Hi,


We believe that upon using a supported version of OS from the list (https://www.intel.com/content/www/us/en/developer/articles/system-requirements/vtune-profiler-system-requirements.html), the issue will not reoccur. If you are running into issues after moving to a supported version of OS, please let us know and we can continue troubleshooting.



Thanks.


0 Kudos
AckoftOvak
Beginner
4,549 Views

Right, changing the OS is an easy solution. No worries, I will fix your bug.

0 Kudos
AthiraM_Intel
Moderator
4,496 Views

Hi,


We are sorry for the inconvenience caused. If you are facing any issue after moving to a supported version of OS, please post a new question as this thread will no longer be monitored by Intel.


Thanks



0 Kudos
AckoftOvak
Beginner
4,485 Views

> We are sorry for the inconvenience caused.

You are not. If you were, you would have fixed it. It's a half an hour work.

 

> If you are facing any issue after moving to a supported version of OS, please post a new question

I got it from the first time. What is your purpose of rubbing it in?

 

> this thread will no longer be monitored by Intel.

Fine with me. Buy.

0 Kudos
superlupo
Beginner
2,244 Views

replace

pmu_class = class_create(THIS_MODULE, SOCPERF_DRIVER_NAME);

with

pmu_class = class_create(SOCPERF_DRIVER_NAME);

 

And maybe think about buying Intel again

Hoon
Employee
102 Views

Thanks! This worked to fix the PTAT (Intel Thermal Analysis Tool) installing the driver in CentOS 9 (with kernel 5.14.0-457.el9.x86_64).

For anyone else looking for a fix, I had to edit the file ptusys_drv.c and change following:

 

ptusysClass = class_create(THIS_MODULE, CLASS_NAME);

to

ptusysClass = class_create(CLASS_NAME);

 

yuzhang3_intel
Moderator
62 Views

There is one discussion of a similar issue, and bug fixes are posted in the following link.

https://community.intel.com/t5/Analyzers/redhat9-5-14-0-kernal-header-changes-break-sepdk-build/m-p/1605449#M24818

 

0 Kudos
Reply