Skip to contentSkip to conversation

Kernel symbol version history

DISCUSSION David H. Lynch Jr. 4 participants 5 messages Dec 5, 2007 – Dec 9, 2007

lore
Share & tools
lore
#0 lore raw

This might be slightly OT here, but would anyone know where there
might be a reference that indicates at precisely what version a given symbol either appeared or disappeared within the Linux kernel ?

As an example if a driver is supposed to work for 2.6 and 2.4 and
uses sysfs, or cdev, or alloc_chr_dev_region or ...
How can one tell at what point that api or symbol appeared so that
the proper conditionals appear within the driver.

The last one that bit me was I made a collection of casting changes
to address 64bit vs. 32bit targets, and found that using the C99 fixed size types - uint32_t, ... made life much more pleasant, after putting them I nobody else could build because uintptr_t did not appear until 2.6.24, and I still have not figured out exactly when uint32_t etc. appeared.

I would think there ought to be some resource besides group memory
to look this up ?
Is there a way to use git to look back through the history of a
symbol rather than a file.

Signature · 8 lines
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       [email protected] 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein
#1 lore raw
Quoted 8 lines · David H. Lynch Jr.

This might be slightly OT here, but would anyone know where there
might be a reference that indicates at precisely what version a given symbol either appeared or disappeared within the Linux kernel ?

As an example if a driver is supposed to work for 2.6 and 2.4 and
uses sysfs, or cdev, or alloc_chr_dev_region or ...
How can one tell at what point that api or symbol appeared so that
the proper conditionals appear within the driver.

the 'gitk' tool allows you to search for the addition or removal of a string. You

Quoted 8 lines

The last one that bit me was I made a collection of casting changes
to address 64bit vs. 32bit targets, and found that using the C99 fixed size types - uint32_t, ... made life much more pleasant, after putting them I nobody else could build because uintptr_t did not appear until 2.6.24, and I still have not figured out exactly when uint32_t etc. appeared.

Quoted 4 lines

I would think there ought to be some resource besides group memory
to look this up ?
Is there a way to use git to look back through the history of a
symbol rather than a file.

grant@trillian:~/hacking/linux-2.6$ grep "uint32_t" include/* -r | grep typedef
include/linux/types.h:typedef           __u32           uint32_t;
grant@trillian:~/hacking/linux-2.6$ git log -p include/linux/types.h | vim -
(Search for the string uint32_t)

Looks like it was there before Linus started using git.

Quoted 18 lines

--
Dave Lynch DLA Systems
Software Development: Embedded Linux
717.627.3770 [email protected] http://www.dlasys.net
fax: 1.253.369.9244 Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction." Albert Einstein

_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[email protected]
(403) 399-0195
#2 lore raw
In reply to David H. Lynch Jr.

Hi David,

You could try the various "linux cross reference" web site out there. It is not necessarily complete (some linux version might be missing) but it can be usefull to lookup if some symbols/define/typedef were available in a particular Linux version.

Have a look there.

http://free-electrons.com/community/kernel/lxr

Regards

JC

Quoted 20 lines · On Wednesday 05 December 2007 17:17:25 David H. Lynch Jr. wrote:

This might be slightly OT here, but would anyone know where there
might be a reference that indicates at precisely what version a given symbol either appeared or disappeared within the Linux kernel ?

As an example if a driver is supposed to work for 2.6 and 2.4 and
uses sysfs, or cdev, or alloc_chr_dev_region or ...
How can one tell at what point that api or symbol appeared so that
the proper conditionals appear within the driver.

The last one that bit me was I made a collection of casting changes
to address 64bit vs. 32bit targets, and found that using the C99 fixed size types - uint32_t, ... made life much more pleasant, after putting them I nobody else could build because uintptr_t did not appear until 2.6.24, and I still have not figured out exactly when uint32_t etc. appeared.

I would think there ought to be some resource besides group memory
to look this up ?
Is there a way to use git to look back through the history of a
symbol rather than a file.

#3 lore raw

Thank you.

I made use of one of the linux cross reference sites. Though unless I don't know how to effectively use them trying to
track the history of a function, typdef, define, ..
is not particularly easy using lxr.

Grant's sugestion with git was closer to what I was looking for -
except that in some instances
needed to go back farther than it would take me..

Quoted 41 lines · Jean-Christophe Dubois

Hi David,

You could try the various "linux cross reference" web site out there. It is not necessarily complete (some linux version might be missing) but it can be usefull to lookup if some symbols/define/typedef were available in a particular Linux version.

Have a look there.

http://free-electrons.com/community/kernel/lxr

Regards

JC

Quoted 21 lines · On Wednesday 05 December 2007 17:17:25 David H. Lynch Jr. wrote:

This might be slightly OT here, but would anyone know where there
might be a reference that indicates at precisely what version a given symbol either appeared or disappeared within the Linux kernel ?

As an example if a driver is supposed to work for 2.6 and 2.4 and
uses sysfs, or cdev, or alloc_chr_dev_region or ...
How can one tell at what point that api or symbol appeared so that
the proper conditionals appear within the driver.

The last one that bit me was I made a collection of casting changes
to address 64bit vs. 32bit targets, and found that using the C99 fixed size types - uint32_t, ... made life much more pleasant, after putting them I nobody else could build because uintptr_t did not appear until 2.6.24, and I still have not figured out exactly when uint32_t etc. appeared.

I would think there ought to be some resource besides group memory
to look this up ?
Is there a way to use git to look back through the history of a
symbol rather than a file.

Signature · 8 lines
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       [email protected] 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein
#4 lore raw
In reply to David H. Lynch Jr.
Quoted 9 lines · David H. Lynch Jr.

This might be slightly OT here, but would anyone know where there might be a reference that indicates at precisely what version a given symbol either appeared or disappeared within the Linux kernel ?

As an example if a driver is supposed to work for 2.6 and 2.4 and
uses sysfs, or cdev, or alloc_chr_dev_region or ...
How can one tell at what point that api or symbol appeared so that
the proper conditionals appear within the driver.

Quoted 6 lines

The last one that bit me was I made a collection of casting changes
to address 64bit vs. 32bit targets, and found that using the C99 fixed size types - uint32_t, ... made life much more pleasant, after putting them I nobody else could build because uintptr_t did not appear until 2.6.24, and I still have not figured out exactly when uint32_t etc. appeared.

I believe the standard C99 types like uint32_t have been there for ever, basically. Maybe not in Linux 1.0, but as far back as anyone might ever sensibly care.

That doesn't include uintptr_t though. For that we usually use 'unsigned long'. If ever there is an architecture where 'unsigned long' isn't big enough for a pointer, Linux is going to break :)

Quoted 4 lines

I would think there ought to be some resource besides group memory
to look this up ?
Is there a way to use git to look back through the history of a
symbol rather than a file.

pmac /pmac/git/libertas-2.6 $ git-annotate include/linux/types.h | grep uintptr_t
142956af ( Al Viro 2007-10-29 05:11:28 +0000 40)typedef unsigned long uintptr_t;
pmac /pmac/git/libertas-2.6 $ git-show 142956af
commit 142956af525002c5378e7d91d81a01189841a785

Author: Al Viro <[email protected]>
Date:   Mon Oct 29 05:11:28 2007 +0000

fix abuses of ptrdiff_t

Use of ptrdiff_t in places like

- if (!access_ok(VERIFY_WRITE, u_tmp->rx_buf, u_tmp->len))
+ if (!access_ok(VERIFY_WRITE, (u8 __user *)
+ (ptrdiff_t) u_tmp->rx_buf,
+ u_tmp->len))

is wrong; for one thing, it's a bad C (it's what uintptr_t is for; in general we are not even promised that ptrdiff_t is large enough to hold a pointer, just enough to hold a difference between two pointers within the same object). For another, it confuses the fsck out of sparse.

Use unsigned long or uintptr_t instead. There are several places misusing ptrdiff_t; fixed.

Signature · 1 line
dwmw2