LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-09-2018, 09:53 AM   #1
alxhoff
LQ Newbie
 
Registered: Nov 2018
Location: Munich, Germany
Distribution: Arch
Posts: 4

Rep: Reputation: Disabled
Including header from separate driver tree make issues


Hi all,

I have been stuck on a problem for a couple of days now and am hoping someone can help me out.

I am looking into power management in the cpufreq module and need to get some stats from the GPU. I am developing the proof of concept for an Odroid XU3 board running a 3.10.9 kernel with a mali GPU. The stats I need can be exported from gpu_ipa.h. I am quite new to exporting symbols in the linux kernel so I hope what I am doing is actually the right approach.

My plan is to patch the midgard driver currently controlling the GPU to export the stats that are normally exposed via sysfs such that my cpufreq governor can access them. My first step was to try and get the gpu_ipa.h header included in my governor but I have since run into build errors.

I posted here but haven't had any luck.

From reading the documentation on the kernel build system it seems that what I should do is use a Kbuild file to build my module. Now I am not 100% sure, but I think because the kernel for this board is so old that the build system is a Kbuild/make mashup as my driver tree (cpufreq) doesn't have a Kbuild. I have tried making a Kbuild file in accordance to the documentation but have not had any luck. I have tried modifying the make file such that my module's entry looked like

Code:
ccflags-$(CONFIG_CPU_FREQ_GOV_OPTIGAME) := -I../gpu/arm/midgard 
obj-$(CONFIG_CPU_FREQ_GOV_OPTIGAME) += optigame_governor.o optigame_governor_sched.o optigame_governor_stats.o
I have never had do any modifying to Makefiles when i've developed kernel stuff and I am not sure my knowledge of make is good enough for a project as large as the kernel. I am begging for some help as this has really thrown a stopped on my research.

Cheers
 
Old 11-10-2018, 09:03 AM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
For your module to compile, you need to have the CONFIG_CPU_FREQ_GOV_OPTIGAME option set to y or m in the kernel config. Have you added it to Kconfig?
 
Old 11-12-2018, 03:32 AM   #3
alxhoff
LQ Newbie
 
Registered: Nov 2018
Location: Munich, Germany
Distribution: Arch
Posts: 4

Original Poster
Rep: Reputation: Disabled
I have an entry in the cpufreq Kconfig as follows

Code:
 config CPU_FREQ_GOV_OPTIGAME
     tristate "'optigame' cpufreq governor"
     depends on CPU_FREQ
     help
         'optigame' - optimized for games
 
         If in doubt, say N.

 config CPU_FREQ_DEFAULT_GOV_OPTIGAME
     bool "optigame"
     select CPUT_FREQ_GOV_OPTIGAME
     help
         User the CPUFreq governor 'optigame' as default
The module always built correctly prior to me wanting to add in the gpu integration. My problems have only started when I wanted to include the gpu_ipa.h header.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] c++ library including a header within a header knobby67 Programming 2 05-12-2016 06:14 AM
problem with including user defined header file wch705 Programming 2 04-29-2011 08:09 AM
Priority in including header jkim74 Linux - Embedded & Single-board computer 1 07-29-2010 10:21 PM
Including c++ header files cbabbage Programming 6 10-28-2009 09:36 PM
Including header file using HTML hoho4rd Programming 4 12-05-2006 11:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration