list_for_each_entry_safe(ip, tmp, &file->ip_list, list) {
img_del_ip_by_list(ip);
- free_img_ip(ip);
+ img_ip_free(ip);
}
kfree(file);
return 0;
}
- ip = create_img_ip(addr, pd);
+ ip = img_ip_create(addr, pd);
if (ip == NULL)
return -ENOMEM;
img_add_ip_by_list(file, ip);
}
img_del_ip_by_list(ip);
- free_img_ip(ip);
+ img_ip_free(ip);
return 0;
}
* @breaf Image of file
*/
struct img_file {
- struct list_head list; /**< For img_proc */
+ /* img_proc */
+ struct list_head list; /**< List for img_proc */
+
+ /* img_ip */
+ struct list_head ip_list; /**< Head for img_ip */
+
struct dentry *dentry; /**< Dentry of file */
- struct list_head ip_list; /**< For img_ip */
atomic_t use;
};
* @param probe_i Pointer to the probe info data.
* @return Pointer to the created img_ip struct
*/
-struct img_ip *create_img_ip(unsigned long addr, struct probe_desc *pd)
+struct img_ip *img_ip_create(unsigned long addr, struct probe_desc *pd)
{
struct img_ip *ip;
return NULL;
INIT_LIST_HEAD(&ip->list);
- INIT_LIST_HEAD(&ip->ihead);
+ INIT_LIST_HEAD(&ip->sspt_head);
ip->addr = addr;
ip->desc = pd;
* @param ip remove object
* @return Void
*/
-void free_img_ip(struct img_ip *ip)
+void img_ip_free(struct img_ip *ip)
{
struct sspt_ip *p, *n;
- list_for_each_entry_safe(p, n, &ip->ihead, img_list) {
+ list_for_each_entry_safe(p, n, &ip->sspt_head, img_list) {
list_del_init(&p->img_list);
p->img_ip = NULL;
list_del(&p->list);
* @breaf Image of instrumentation pointer
*/
struct img_ip {
- struct list_head list; /**< For img_file */
+ /* img_file */
+ struct list_head list; /**< List for img_file */
+
+ /* sspt_ip */
+ struct list_head sspt_head; /**< Head for sspt_ip */
+
unsigned long addr; /**< Function address */
- struct list_head ihead; /**< List head for sspt ip */
struct probe_desc *desc; /**< Probe info */
};
-struct img_ip *create_img_ip(unsigned long addr, struct probe_desc *info);
-void free_img_ip(struct img_ip *ip);
+struct img_ip *img_ip_create(unsigned long addr, struct probe_desc *info);
+void img_ip_free(struct img_ip *ip);
/* debug */
void img_ip_print(struct img_ip *ip);
struct img_proc {
- struct list_head file_list;
+ /* img_file */
+ struct list_head file_head;
rwlock_t rwlock;
};
*
* @return Pointer to the created img_proc struct
*/
-struct img_proc *create_img_proc(void)
+struct img_proc *img_proc_create(void)
{
struct img_proc *proc;
proc = kmalloc(sizeof(*proc), GFP_ATOMIC);
if (proc) {
- INIT_LIST_HEAD(&proc->file_list);
+ INIT_LIST_HEAD(&proc->file_head);
rwlock_init(&proc->rwlock);
}
* @param file remove object
* @return Void
*/
-void free_img_proc(struct img_proc *proc)
+void img_proc_free(struct img_proc *proc)
{
struct img_file *file, *tmp;
write_lock(&proc->rwlock);
- list_for_each_entry_safe(file, tmp, &proc->file_list, list) {
+ list_for_each_entry_safe(file, tmp, &proc->file_head, list) {
img_del_file_by_list(file);
img_file_put(file);
}
/* called with write_[lock/unlock](&proc->rwlock) */
static void img_add_file_by_list(struct img_proc *proc, struct img_file *file)
{
- list_add(&file->list, &proc->file_list);
+ list_add(&file->list, &proc->file_head);
}
/* called with write_[lock/unlock](&proc->rwlock) */
{
struct img_file *file;
- list_for_each_entry(file, &proc->file_list, list) {
+ list_for_each_entry(file, &proc->file_head, list) {
if (file->dentry == dentry) {
img_file_get(file);
return file;
struct img_file *i_file;
read_lock(&i_proc->rwlock);
- list_for_each_entry(i_file, &i_proc->file_list, list) {
+ list_for_each_entry(i_file, &i_proc->file_head, list) {
file = sspt_proc_find_file_or_new(proc, i_file->dentry);
if (file) {
struct img_ip *i_ip;
printk(KERN_INFO "### img_proc_print:\n");
read_lock(&proc->rwlock);
- list_for_each_entry(file, &proc->file_list, list) {
+ list_for_each_entry(file, &proc->file_head, list) {
img_file_print(file);
}
read_unlock(&proc->rwlock);
struct probe_desc;
-struct img_proc *create_img_proc(void);
-void free_img_proc(struct img_proc *proc);
+struct img_proc *img_proc_create(void);
+void img_proc_free(struct img_proc *proc);
int img_proc_add_ip(struct img_proc *proc, struct dentry *dentry,
unsigned long addr, struct probe_desc *pd);
if (pfg == NULL)
return NULL;
- pfg->i_proc = create_img_proc();
+ pfg->i_proc = img_proc_create();
if (pfg->i_proc == NULL)
goto create_pfg_fail;
{
struct pl_struct *pl, *n;
- free_img_proc(pfg->i_proc);
+ img_proc_free(pfg->i_proc);
free_pf(&pfg->filter);
list_for_each_entry_safe(pl, n, &pfg->proc_list, list) {
sspt_proc_del_filter(pl->proc, pfg);
ip->offset = img_ip->addr;
ip->desc = img_ip->desc;
ip->img_ip = img_ip;
- list_add(&ip->img_list, &img_ip->ihead);
+ list_add(&ip->img_list, &img_ip->sspt_head);
return ip;
}