[REFACTOR] ip struct page initialization 59/33659/2
authorAlexander Aksenov <a.aksenov@samsung.com>
Mon, 20 Oct 2014 10:21:16 +0000 (14:21 +0400)
committerAlexander Aksenov <a.aksenov@samsung.com>
Tue, 24 Feb 2015 08:18:32 +0000 (11:18 +0300)
*page field now is filled at create_ip()

Change-Id: I8e3d32da5d0bd7d0d5512b4897d6523e3410be16
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
us_manager/sspt/ip.c
us_manager/sspt/ip.h
us_manager/sspt/sspt_file.c
us_manager/sspt/sspt_page.c

index 6e85c87..91ef57f 100644 (file)
  * @param page User page
  * @param offset Function offset from the beginning of the page
  * @param probe_i Pointer to the probe data.
+ * @param page Pointer to the parent sspt_page struct
  * @return Pointer to the created us_ip struct
  */
-struct us_ip *create_ip(unsigned long offset, const struct probe_info *probe_i)
+struct us_ip *create_ip(unsigned long offset, const struct probe_info *probe_i,
+                       struct sspt_page *page)
 {
        size_t len = probe_i->size;
        struct us_ip *ip;
@@ -48,6 +50,7 @@ struct us_ip *create_ip(unsigned long offset, const struct probe_info *probe_i)
 
                INIT_LIST_HEAD(&ip->list);
                ip->offset = offset;
+               ip->page = page;
 
                probe_info_copy(probe_i, &ip->probe_i);
                probe_info_init(&ip->probe_i, ip);
index 27737ce..7229f03 100644 (file)
@@ -50,7 +50,8 @@ struct us_ip {
 
 #define to_us_ip(rp) container_of(rp, struct us_ip, retprobe)
 
-struct us_ip *create_ip(unsigned long offset, const struct probe_info *probe_i);
+struct us_ip *create_ip(unsigned long offset, const struct probe_info *probe_i,
+                       struct sspt_page *page);
 void free_ip(struct us_ip *ip);
 
 #endif /* __IP__ */
index 91b0cdf..86fb448 100644 (file)
@@ -172,7 +172,7 @@ void sspt_file_add_ip(struct sspt_file *file, unsigned long offset,
        struct sspt_page *page = sspt_find_page_or_new(file, offset & PAGE_MASK);
 
        // FIXME: delete ip
-       struct us_ip *ip = create_ip(offset, probe_i);
+       struct us_ip *ip = create_ip(offset, probe_i, page);
 
        sspt_add_ip(page, ip);
 }
index 31369cf..64eab79 100644 (file)
@@ -77,7 +77,6 @@ void sspt_page_free(struct sspt_page *page)
 static void sspt_list_add_ip(struct sspt_page *page, struct us_ip *ip)
 {
        list_add(&ip->list, &page->ip_list_no_inst);
-       ip->page = page;
 }
 
 static void sspt_list_del_ip(struct us_ip *ip)