2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 19:53:59 +08:00
linux-next/include/linux/dcookies.h
Bob Nelson 1474855d08 [CELL] oprofile: add support to OProfile for profiling CELL BE SPUs
From: Maynard Johnson <mpjohn@us.ibm.com>

This patch updates the existing arch/powerpc/oprofile/op_model_cell.c
to add in the SPU profiling capabilities.  In addition, a 'cell' subdirectory
was added to arch/powerpc/oprofile to hold Cell-specific SPU profiling code.
Exports spu_set_profile_private_kref and spu_get_profile_private_kref which
are used by OProfile to store private profile information in spufs data
structures.

Also incorporated several fixes from other patches (rrn).  Check pointer
returned from kzalloc.  Eliminated unnecessary cast.  Better error
handling and cleanup in the related area.  64-bit unsigned long parameter
was being demoted to 32-bit unsigned int and eventually promoted back to
unsigned long.

Signed-off-by: Carl Love <carll@us.ibm.com>
Signed-off-by: Maynard Johnson <mpjohn@us.ibm.com>
Signed-off-by: Bob Nelson <rrnelson@us.ibm.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
2007-07-20 21:42:24 +02:00

70 lines
1.3 KiB
C

/*
* dcookies.h
*
* Persistent cookie-path mappings
*
* Copyright 2002 John Levon <levon@movementarian.org>
*/
#ifndef DCOOKIES_H
#define DCOOKIES_H
#ifdef CONFIG_PROFILING
#include <linux/dcache.h>
#include <linux/types.h>
struct dcookie_user;
/**
* dcookie_register - register a user of dcookies
*
* Register as a dcookie user. Returns %NULL on failure.
*/
struct dcookie_user * dcookie_register(void);
/**
* dcookie_unregister - unregister a user of dcookies
*
* Unregister as a dcookie user. This may invalidate
* any dcookie values returned from get_dcookie().
*/
void dcookie_unregister(struct dcookie_user * user);
/**
* get_dcookie - acquire a dcookie
*
* Convert the given dentry/vfsmount pair into
* a cookie value.
*
* Returns -EINVAL if no living task has registered as a
* dcookie user.
*
* Returns 0 on success, with *cookie filled in
*/
int get_dcookie(struct dentry * dentry, struct vfsmount * vfsmnt,
unsigned long * cookie);
#else
static inline struct dcookie_user * dcookie_register(void)
{
return NULL;
}
static inline void dcookie_unregister(struct dcookie_user * user)
{
return;
}
static inline int get_dcookie(struct dentry * dentry,
struct vfsmount * vfsmnt, unsigned long * cookie)
{
return -ENOSYS;
}
#endif /* CONFIG_PROFILING */
#endif /* DCOOKIES_H */